What a Sitemap Should Include on a Static Directory Site

A local directory can end up with thousands of pages very quickly. One county page, a page for every city in it, a page for each category in each city, and a page for every business. Search engines find most of those pages by following links, but a sitemap gives them the full list in one file, and on a static site that file is something you control completely.

That control cuts both ways. A static sitemap only says what you generated it to say, so a careless build can list pages that redirect, pages you meant to hide, or the same page twice under different URLs. This post walks through what belongs in the sitemap of a static directory, what to leave out, and how to keep it honest when the listing data changes.

Start from the pages you actually want found

Before thinking about XML, write down the page types your directory produces. Most local directories built from Google Maps data have a similar set: a homepage, county or region pages, city pages, category pages, city and category combinations, individual listing pages, and a handful of static pages like about and contact. If you want a refresher on that structure, there is a rundown of the page types every local directory needs that covers each one.

Then ask a blunt question about each type. Would someone searching on Google be glad to land here? A city page with forty plumbers on it passes easily. A city and category combination with zero businesses does not, and neither does a filtered search URL that only exists because someone clicked a checkbox. The sitemap should reflect the first group only.

What to include

The safe default is every page that returns a normal 200 response, has its own content, and points to itself as the canonical version. On a typical directory that means:

  • The homepage and the main county or region pages
  • City pages that have at least a few listings
  • Category pages and city plus category pages that have real results
  • Each business listing page that you have kept after cleaning the data
  • Useful static pages such as a how-to-get-listed page

Static pages that exist only for legal reasons, like a privacy policy, can go in or stay out. They rarely matter either way.

What to leave out

Leaving pages out of a sitemap does not hide them from search engines, but it keeps the signal clean. Skip anything that redirects, anything marked noindex, internal search result pages, paginated duplicates if your city pages split across several URLs with the same intro, and any listing you have flagged as closed but still keep around for reference.

Watch for trailing slash mismatches too. If your site serves city pages at a URL ending in a slash, the sitemap should use that exact form. A static generator will happily print one version in the sitemap and link to the other in the navigation, and that kind of small inconsistency is easy to miss for months.

Splitting large sitemaps

Google's documentation sets a limit of 50,000 URLs or 50MB uncompressed for a single sitemap file. Most directories never hit that, but a statewide directory across several categories can. When you get close, split the sitemap into several files and list them in a sitemap index file.

Splitting by page type is the most practical choice for a directory. One file for listings, one for city and category pages, one for everything else. When you later look at indexing reports in Search Console, separate files make it obvious which page type is struggling. If listings are being crawled but city pages are not, you know where to look.

Keeping lastmod honest

The lastmod field tells search engines when a page last changed. Google has said it uses lastmod when the value is consistently accurate, and that it ignores the priority and changefreq fields. That means a static directory should set lastmod from real changes, and the easiest mistake is stamping every URL with the build date.

A better approach is to store a last changed date for each listing in your data. When you refresh the export and a business has a new phone number, new hours or a new address, update that listing's date. City and category pages can take the most recent date of the listings they show. Pages whose content did not change keep their old date, even though the build ran again.

Submitting and checking the sitemap

Reference the sitemap from your robots.txt file with a Sitemap line, then submit it in Google Search Console and Bing Webmaster Tools. After that, the reports are where the useful information lives. Look at how many submitted URLs are indexed, and read the reasons given for the ones that are not.

A large gap between submitted and indexed pages on a directory usually points to thin pages. Listing pages with only a name and a phone number are the common culprit. Adding opening hours, a short description, the category, and a map often helps more than any sitemap change, because the sitemap can only invite a crawler to a page. It cannot make the page worth indexing.

For more on build settings, hosting and the other plumbing behind these sites, there are notes on the technical side of static directory sites that go further than this post. And if you are starting from a raw export rather than a finished site, 1 Click Directory Builder turns a Google Maps export from Outscraper, Apify or any scraper into a complete directory with a sitemap already generated.

Questions about directory sitemaps

Do I need a separate image sitemap for listing photos?

Usually not. Images placed in normal img tags on listing pages are found when the page is crawled. An image sitemap is mainly useful when images load in ways a crawler might miss.

Should empty city pages be in the sitemap?

No. If a city has no listings in your data, either do not generate the page or keep it out of the sitemap and add listings before you promote it.

How often should I regenerate the sitemap?

Every time you rebuild the site with new data. On a static site the sitemap is just another output file, so regenerate it in the same build step and it will always match the pages that exist.

Comments

Popular posts from this blog

How to Choose Colors and Icons for a Niche Directory

How to Organize Daycare and Tutor Listings for Parents

How to Pick a Niche for Your First Local Directory