• Resolved Vadim

    (@vadikcoma)


    Hello, is there a way to set rel=nofollow for all external links except specific links?

    As an example – we run large media website, and all external links must be nofollow. However sometimes we offer paid promotions and in that case link must be dofollow.

    Is there a way to make it work with SEO Framework? If not – maybe you can suggest good solution?

Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi Vadim,

    I’ve never needed such a plugin, as I manually write HTML and add those tags where I deem necessary. So, I’m afraid I can’t help you with your plugin search.

    If you’re interested in coding this yourself, I did find it entertaining to come up with a regex that might work for you:

    /<a\shref=("|'|)?(https?:)?\/\/([a-z0-9\-]{1,253}\.[a-z]{2,})(.[a-z]+)?\1?[^>]*>.*?<\/a>/i
    

    With that, you’d want to test group 3 for allowed domains on filter the_content. From thereon, you must apply or overwrite the rel=nofollow tag. I didn’t get that far, yet.

Viewing 1 replies (of 1 total)
  • The topic ‘Setting rel=nofollow for all external links except specific’ is closed to new replies.