Google Sitemap hack together

A Sitemap file lets you tell Google about all the pages on your site, and optionally, information about those pages, such as which are most important and how often they change. By submitting a Sitemap file, you can take control of the first part of the Google  crawling / indexing processes: Google discovery of the pages.

This may be particularly helpful if your site has dynamic content, pages that aren't easily discovered by following links, or if your site is new and has few links to it. In general it offers:

  • Better crawl coverage to help people find more of your web pages
  • Fresher search results
  • A smarter crawl because you can provide specific information about all your web pages, such as when a page was last modified or how frequently a page changes.

When Google released their Google Sitemaps Program, there was a big influx in forums and news-groups, with questions such as

  • Do I need a sitemap?
  • How do I create a Sitemap file?
  • Is there a module for my program that can generate Google Sitemaps?
  • What is the quickest and simplest way to generate a sitemap for Google?

For me it seemed a lot of work for something that Google seemed to do alright already. I wanted a quick solution for my site that would be very useful for Google.

The result was to create an RSS feed with an unlimited number of entries, just for Google. As most websites and website systems allow RSS it was not hard to make a small change and allow the RSS feed that we give Google to have an entry for every news items that was ever posted.

Although the code may be different on your website, the general idea is to find the section of code that limits the number of items for each RSS feed. In my case it was along the lines of an SQL statement:


By removing the LIMIT 20 from the SQL when the user-agent string contained 'Google', I allowed Google to get an RSS feed of every page on my site.

by 1.1K

Remember to vote! Voting helps everyone find the best posts

Tags: None