• Hi,
    currently inside the Gutenberg editor, if I add an image and then click on the link icon to hyperlink that image to some URL, after adding the URL if I turn on the Open in New Tab toggle, it automatically adds the noreferrer noopener rel attribute to the link.

    Similarly if I add a button block and link that button to some URL and then toggle the Open in new tab option, it will also add norefere noopener rel attribute to that button.

    Now what I am looking for is to change that default rel attribute from lets say noreferer noopener to sponsored nofollow noopener. Does anyone have any idea on how to achieve that?

    I’ve looked at /wp-includes/blocks/button/block.json and also /wp-includes/blocks/image/blocks.json to see if there is any attribute which I might overwrite in my theme’s theme.json file to change the default value.

    But unfortunately, I did not find anything in those JSON files which might help me to overwrite the default rel attributes. So, if anyone has already figured this out, it would be really helpful if you can help. Thanks.

    • This topic was modified 2 years, 3 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change default rel attributes for Image Block & Button Block’ is closed to new replies.