1 Star2 Stars3 Stars4 Stars5 Stars (10 votes, average: 5.00 out of 5)

Why Put NoFollow Attributes In Menu Structure?

Why put nofollow attributes in menu structure? In a nutshell it all boils down to relevance. Every link on your particular web page should have to do with the subject that it is about. In this article I am talking about the nofollow attribute. However if you look above at my menu I have several things that have nothing to do with the nofollow attribute.

What is a NoFollow attribute? *

A nofollow attribute is a code that is put into an anchor link. It lets search engines know that when they come to spider and index your page that you have links on the page that have nothing to do with the subject matter on that particular page. The no follow code attribute looks like this.

<a href="a1websitepro.com" rel="nofollow">Anchor Text</a>

How do I add nofollow in my WordPress Menu Structure? *

Its a little hard to locate  so I will show you in pictures below how to do it. First off make sure that you are using a “custom menu structure” in WordPress. Here is a little video that will help you set up a custom menu in WordPress if you don’t know how.

Subscribe To My YouTube Channel:

One you have your custom menu set up in WordPress follow these steps to make your menu items contain the nofollow attribute.

  1. Go to Appearance > Menu
  2. Open your “Screen Options” in the top right side of the screen. screen options in appearance menu
  3. Make sure under “Show Advanced Menu Properties” that “Link Relationship (XFN)” is checked. Link Relationship (XFN)
  4. Open each of your menu items and add the nofollow text in each of the links. Why Put NoFollow Attributes In Menu Structure?
  5. Now when you go to the front of your website you will have nofollow on your menu items. Now when the search engines spider your page you will not get penalized for linking to irrelevant content on your webpage. 🙂

A WordPress Function to Make all Links nofollow *

I do not encourage all links to be made nofollow in a website. If you are linking to relevant content then you should follow those links through. This not only gives your visitor good information but also gives you link juice for providing good relevant links to your visitors. However if you have a large website and do not want to go back and make all of your links nofollow here is a WordPress function that will take care of all the links in your wordpress and make a nofollow attribute to them. You would put this in your functions.php file in your theme.

add_filter( 'the_content', 'cn_nf_url_parse');

function cn_nf_url_parse( $content ) {

 $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>";
 if(preg_match_all("/$regexp/siU", $content, $matches, PREG_SET_ORDER)) {
 if( !empty($matches) ) {

 $srcUrl = get_option('home');
 for ($i=0; $i < count($matches); $i++)
 {

 $tag = $matches[$i][0];
 $tag2 = $matches[$i][0];
 $url = $matches[$i][0];

 $noFollow = '';

 $pattern = '/target\s*=\s*"\s*_blank\s*"/';
 preg_match($pattern, $tag2, $match, PREG_OFFSET_CAPTURE);
 if( count($match) < 1 )
 $noFollow .= ' target="_blank" ';

 $pattern = '/rel\s*=\s*"\s*[n|d]ofollow\s*"/';
 preg_match($pattern, $tag2, $match, PREG_OFFSET_CAPTURE);
 if( count($match) < 1 )
 $noFollow .= ' rel="nofollow" ';

 $pos = strpos($url,$srcUrl);
 if ($pos === false) {
 $tag = rtrim ($tag,'>');
 $tag .= $noFollow.'>';
 $content = str_replace($tag2,$tag,$content);
 }
 }
 }
 }

 $content = str_replace(']]>', ']]&gt;', $content);
 return $content;

}

Understanding Links *

Remember that “Websites” are NOT indexed but “WebPages” ARE! Web Pages are posts, pages, categories, tags etc that you have in your wordpress website. Now each one of these web pages must contain relevant content within them that deals with the subject matter on that particular page. Whatever you are linking too must also have something to do with the targeted subject matter on that webpage. Anchor text is whatever keyword text you are using to link to another web page on the internet. This too should contain text that is relevant to the subject matter.

<a href=”http://somewebsite.com” rel=”nofollow”>This is anchor text</a>

So Why Put NoFollow Attributes In Menu Structure? *

Websites contain many links usually and many different subjects. That is why we have categories and tags. Your main menu probably 95% of the time has really nothing to do with the subject matter on your posts or pages. Remember that all your menu is to the search engine is a bunch of anchor links just like another link on a webpage. So do yourself a favor and put “nofollow” on them.

Are there Exceptions to nofollow In the Menu Structure? *

Yes, if your website and all its links only contain one subject matter then dont worry about it. For instance if my entire website was about nofollow links and I only linked to nofollow subject matter I would not have to worry about putting nofollow attributes on anything within my website at all.

Why Put NoFollow Attributes In Menu Structure? was last modified: May 22nd, 2015 by Maximus Mccullough

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips

Tips

Why Put NoFollow Attributes In Menu Structure?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.