Major Problem solved with WordPress & Google
-
After getting WordPress and setting up my site, I soon found problems with Google not indexing my site. When reading up on the problem, I couldn’t really find an answer to the problem other than people saying to just give it time. With my passed sites, I found Google to be able to index the sites with in minutes.
Well, I gave it a week and a day and still no action from Google. Google was crawling my site like mad:
Number of pages crawled per day
Maximum 359
Average 194
Minimum 45I setup a Google Webmaster tools account, yet Google just would not index my site. This being my first time using WordPress I was starting to wonder if maybe Google had something with WordPress blogs or even the new domain I bought.
Then one day as I was in my car driving home I had an idea of what the problem could be. Racing home to see if my vision was right, I found it was. After fixing the problem, Google index my site within seconds.
The problem?
<?php wp_get_archives(‘type=monthly&format=link’); ?>
What this function does is put in meta links to all archives on a given site such as:
<link rel=”alternate” type=”
This may seem like a great idea, but it’s not at all. What is happening is that you are more or less putting the crawler in a big loop. It’s finding these links in your header and going to them and not even getting to your site which in turn means your site isn’t going to get indexed anytime soon.
So if you find that you are having problems, remove the above function or any other function that adds this type of data in your header. These functions can be found in the theme’s header.php file. An example of a header.php file before cleaning it up looked like this:
<link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<?php bloginfo(‘rss2_url’); ?>” />
<link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<?php bloginfo(‘rss2_url’); ?>” />
<link rel=”alternate” type=”text/xml” title=”RSS .92″ href=”<?php bloginfo(‘rss_url’); ?>” />
<link rel=”alternate” type=”application/atom+xml” title=”Atom 0.3″ href=”<?php bloginfo(‘atom_url’); ?>” />
<link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
<?php wp_get_archives(‘type=monthly&format=link’); ?>I would removed all four such lines of code. Again, after I did remove it, seconds later, Google indexed my site. When I say seconds, I mean seconds. After uploading the header.php file and then going back to Google Webmaster Tools Google showed that it was indexed.
I hope this helps all that may be having problems trying to get their site indexed.
- The topic ‘Major Problem solved with WordPress & Google’ is closed to new replies.