jqueryhtmlcss.htaccessnoindex

make all outgoing links noindex for google


i have too much outgoing link on my website. i want to make them all no index for google. i dont want to write rel="no index" per link...

(< a href="..." rel="noindex, nofollow" >...< /a > )

can i create a class and write this with css?

and then

<div class="noindexlinks">

Is this possible? Or can I edit my htaccess for this?

website


Solution

  • You can not assign html attributes via css.

    You can however accomplish what you are looking to do with an arbitrary css class and some jQuery.

    NOINDEX is a meta tag, you're looking for nofollow on your <a> tags.

    $(".no_follow_links").each(function(){
    	$(this).attr("rel","nofollow");
    });
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <a class="no_follow_links" href="http://google.com">Link</a>
    <a class="no_follow_links" href="http://bing.com">Link</a>
    <a class="no_follow_links" href="http://yahoo.com">Link</a>