Change default rel attributes for Image Block & Button Block
-
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 theOpen in New Tab
toggle, it automatically adds thenoreferrer 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 addnorefere noopener
rel attribute to that button.Now what I am looking for is to change that default
rel
attribute from lets saynoreferer noopener
tosponsored 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’stheme.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.
- The topic ‘Change default rel attributes for Image Block & Button Block’ is closed to new replies.