• Resolved AndreasJa

    (@andreasja)


    Hello!

    I have a custom field with the “Data type” “Link” and I need to set the attributes “nofollow” and “sponsored” on the links.

    As of now I can only add “target=”_blank” with the “Open in new window” option in the templates editor.

    I need it to look like this:

    <a href="https://www.example.com" rel="nofollow sponsored" "target="_blank">example link</a>

    Is there any way to add nofollow and sponsored to all links used with data type “link”?

    Thanks! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter AndreasJa

    (@andreasja)

    Hello again! Are there no solution for this? Thank you in advance.

    Plugin Author Code Amp

    (@codeamp)

    Hey @andreasja

    Not sure how this one slipped through – I’ll add this to the feature requests so we can add functionality for this at some stage.

    We’ll need to add those attributes to our UI.

    Thanks

    Thread Starter AndreasJa

    (@andreasja)

    Thank you @codeamp for the answer.

    I ended up making the changes directly in the plugin code. Even though it’s not “update proof” it will work for now ??

    If anyone else want to know:

    Go to: wp-content\plugins\custom-layouts\includes\template\elements

    -> class-custom-field.php

    -> row 83 change to be:

    $target = ' target="_blank" rel="nofollow noopener sponsored"';

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Set nofollow & sponsored attributes for links’ is closed to new replies.