2

I read through the comments and answers to both How bad is it to use display: none in CSS? and Is hidden content (display: none;) -indexed- by search engines?, but I couldn't see anything related to links.

If I have a menu load up as Display:None and then show it via JavaScript later will those links in the menu get crawled? Is there an impact on PageRank?

It seems as if the answer is yes, it sees them and crawls them and there is no effect on rank flowing through the hidden links... I just can't seem to find a definitive answer.

3 Answers 3

1

More than likely these links will get crawled and be treated like other links on your site (assuming that you don't nofollow them). However, be sure you are are clear on Google's guidelines around hidden text (see https://support.google.com/webmasters/answer/66353). One thing I've learned the hard way related to this is that you you want to make sure Google can access your CSS and JavaScript files (don't block those files via your robots.txt).

Now, all that said, I wouldn't count on Google finding all the pages on your site just because they are in the menu (this is true whether the menu has display:none or not). Make sure the pages are available via links elsewhere on the site, including in the XML sitemap. That way if Google for some reason does not see the display:none links (or, if Google chooses to ignore those links), those pages will still get crawled and indexed (assuming all else being okay with your site of course).

2
  • I tested this on my personal site when I posted this question and Google did not seem to follow the link. I didn't add the page to my sitemap, and I hid the link off of my homepage with style="display:none". Still need to test putting the display none in a style sheet. Commented Jun 30, 2015 at 16:37
  • Interesting. I've been able to get links like this indexed. Will be curious what you see with the style sheet. Honestly, though, I think this gets to the idea that you should never have only one means of Google accessing a page on your site. Don't just put it in the menu, put it in the XML sitemap, HTML sitemap, body copy, etc. Commented Jun 30, 2015 at 19:57
0

why would you want to do that? They may crawl most everything you throw at them, just out of "curiosity", but will probably not index, raise an eyebrow at most.

2
  • Many do not like to see a menu pop out of existence as their page loads when Javascript takes over on page load. I suppose one could add the class via in-line JavaScript and it would reduce the likelyhood of a user seeing the menu, but the goal is to eliminate odd pop-ins and pop-outs as the page loads. Commented Jun 22, 2015 at 20:24
  • Oh, so I figure there are at least some headings of the menu displayed... then this should be treated as expected behaviour. Actually, i don't know about javascript, but I'm pretty sure that if you do it with css pseudo-elements, they are treated just like regular links.
    – lucian
    Commented Jun 22, 2015 at 20:48
0

Yes, they pass PageRank. Content hidden with display:none is not special in any way unless it is used to manipulate the search rankings (which is something else altogether). Those links will be crawled and evaluated the same as links that are visible when the page loads.

2
  • I hate to ask, but: how do you know? Its just that I need to be sure before we potentially break our SEO :) Commented Jun 22, 2015 at 21:29
  • 1
    @TheHonorableSamuelClemens Search engines spider and index HTML pages and until recently with rendering, did not care one whit about style and anything about style. So anything that is HTML will be processed as it always has from the very beginning regardless of what you do with CSS.
    – closetnoc
    Commented Jun 23, 2015 at 3:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.