HAZER
Menu

HomeThe SEO guide for local businesses › What your XML sitemap should and should not contain

SEO Guide · Chapter 11 of 30

What your XML sitemap should and should not contain

This page is for the owner or manager of a local business site who has never opened the sitemap and is not sure it exists. After reading it you will be able to find yours, read it and know what to take out.

In one paragraph

An XML sitemap is a plain list of the page addresses on your site that you want Google to index, and it should contain only those pages. Most local business sitemaps are generated automatically and list hundreds of addresses that should never rank, such as image attachment pages, tag archives, thank-you pages and author pages, which bury the twenty pages that matter. The fix is to trim the sitemap to your service pages, location pages, main blog posts and the few pages a customer would look for, then submit it in Google Search Console and check that every listed page is indexed.

What an XML sitemap is

An XML sitemap is a file on your site, usually at /sitemap.xml or /sitemap_index.xml, that lists the addresses of the pages you want in Google’s index and the date each one last changed. Google reads it to learn which pages exist, which ones are new and which ones have changed since its last visit.

A sitemap does not make a page rank, and a page left out of the sitemap can still be found through links. What the sitemap does is set expectations. When you list a page, you are telling Google that this page is worth indexing. When the list is full of junk, that signal is worthless, because Google learns that your sitemap does not mean what it says.

On a WordPress site the sitemap is built for you by the SEO plugin, and by default it includes every type of content the site can make. That includes the attachment page WordPress creates for every uploaded image.

What a bloated XML sitemap looks like on a med spa site

Willow Creek Aesthetics in Meridian sells treatment packages that average about $1,200 and has nine service pages, one for each treatment it wants to be found for. The site has been up for four years and the sitemap has never been touched.

The sitemap index lists six separate sitemaps. The page sitemap holds 22 addresses, which is about right. The post sitemap holds 31 blog posts, some of them three paragraphs long and last edited in 2022. The attachment sitemap holds 148 addresses, one for every before and after photo ever uploaded, each of which is a page containing nothing but the image and its file name. The category and tag sitemaps hold 27 archive pages, most of which list a single post. The author sitemap holds two pages.

That is 229 addresses handed to Google, of which nine are the pages that sell a treatment. The Pages report in Search Console shows 131 pages marked crawled but not indexed, most of them image pages Google correctly skipped. The report is so noisy that the one service page that is also not indexed, the page for laser hair removal, is invisible in the list.

A worked example: trimming a med spa sitemap in Meridian

The sitemap was reviewed one content type at a time, with a decision for each. The count on the left is what the sitemap contained. The count on the right is what it contained after the change.

SitemapAddresses beforeAddresses afterWhat changed
Pages2217removed 3 thank-you pages, a privacy page and a staging test page
Posts311417 thin posts merged into 4 longer ones or removed
Attachments1480attachment pages redirected to their parent page and the sitemap disabled
Categories90archives set to noindex and removed from the sitemap
Tags180tags deleted
Authors20author archives set to noindex and removed
Total23031

The 31 remaining addresses are the nine service pages, two location pages, the about and financing pages and 14 posts that each answer a real question about a treatment, every one a page the spa wants a customer to land on.

The attachment row is the one that matters most. Removing 148 image pages from the sitemap is only half the job, since the pages still exist, so the SEO plugin setting that redirects attachment pages to their parent page closed that door. The category and author archives were handled with a noindex tag rather than deleted, because the site’s blog listing still uses them.

With the sitemap down to 31, the Pages report in Search Console became readable. The laser hair removal page was at the top of the not indexed list, where it turned out to have a canonical tag pointing at the wrong address, left over from a copy of the page made during a redesign.

How to check your own XML sitemap

  1. Type your domain followed by /sitemap.xml into the address bar. If that shows an error, try /sitemap_index.xml and /wp-sitemap.xml. If none of them answer, your site does not have a sitemap and the SEO plugin needs to be set up to produce one.
  2. Open each sitemap listed in the index and count the addresses. Any sitemap named attachment, media, tag, author or date is a candidate for removal. Open a few of the addresses in it and ask whether you would want a customer to land there.
  3. Open Google Search Console and click Sitemaps in the left menu. Confirm your sitemap address is listed with the status Success. If it is not listed, paste the address into the box at the top and submit it.
  4. Click Pages under Indexing. At the top, use the filter to show only pages in your submitted sitemaps. Every address in your sitemap should be indexed. Any address that is not indexed is either junk that should leave the sitemap or a real page with a problem to fix.

What we do about XML sitemaps

You will get a sitemap that lists the pages that bring in customers and nothing else, with the attachment, tag, author and date sitemaps removed and the pages inside them redirected or set to noindex so they stop competing with the pages that matter. The sitemap is submitted in Search Console, and every address in it is checked against the index so that any page Google is skipping gets looked at. A med spa whose local organic search is up 22 percent year to date started with this same review. The sitemap review is part of every site audit.

Questions people ask about SEO: what your XML sitemap should and should not contain

Does every website need an XML sitemap?

Every site with more than a handful of pages should have an XML sitemap, because it is the simplest way to tell Google which pages exist and when they changed. Anything with a blog, multiple locations or pages that are not linked from the menu needs one.

What should be in an XML sitemap?

An XML sitemap should contain only the pages you want to appear in Google, which for a local business means service pages, location pages, the about and contact pages and blog posts that answer a real question. Leave out thank-you pages, image attachment pages, tag and category archives, author pages, search results pages and anything set to noindex.

Where is my sitemap on WordPress?

On a WordPress site running Yoast or Rank Math the sitemap is at your domain followed by /sitemap_index.xml, and on a site with no SEO plugin WordPress itself produces one at /wp-sitemap.xml. Type the address into your browser to see it. The settings for what it includes are inside the SEO plugin under Sitemap.

Should images be in the sitemap?

Images themselves can be listed inside the page entries of a sitemap, but the attachment pages WordPress creates for each image should not be in the sitemap at all. An attachment page is a bare page with one photo and no text, and Google has no reason to index it. Set attachment pages to redirect to the page they belong to and remove the attachment sitemap.

How often should a sitemap be updated?

A sitemap should update itself every time a page is published or edited, which is what the SEO plugin on a WordPress site does automatically. You do not need to resubmit it in Search Console after each change, because Google rereads it on its own. Resubmit only after a major change, such as a site rebuild or a large cleanup.

This page is part of the The SEO guide for local businesses. The other guides: SEO, AEO, GEO.

Have us do this on your site

Send the address of your site. We fetch every page from outside, the way Google does, and send back the list: every page, every flag, and what we would fix first. Then we fix it, verify each change from outside, and report it in plain language every month.

Send us your site