Skip to main content

A to Z Website Solutions

WordPress Troubleshooting

How Do I Create an XML Sitemap in WordPress?

By Nov 09, 2026 20 min read

How Do I Create an XML Sitemap in WordPress?

You’ve created your WordPress website, added your services, written your pages and perhaps started publishing blog posts. But how does Google know those pages exist? And when you publish something new, how do search engines find it?

One useful part of the answer is an XML sitemap. It’s something many small business owners have heard about but aren’t entirely sure what it does. You might have seen a sitemap mentioned in your SEO plugin, noticed an unfamiliar sitemap address or been told that your website needs one to appear on Google.

The good news is that creating an XML sitemap in WordPress is usually much easier than it sounds. In fact, your website may already have one without you realising it. This guide explains how to find it, create one if necessary, check that it contains the correct pages and submit it to Google.

Quick Answer

WordPress automatically generates a basic XML sitemap on most modern installations. To find yours, enter yourwebsite.co.uk/wp-sitemap.xml into your browser, replacing the example domain with your own. If you use an SEO plugin such as Rank Math or Yoast SEO, your sitemap may instead be available at yourwebsite.co.uk/sitemap_index.xml.

If your website doesn’t have a working sitemap, check your existing WordPress and SEO plugin settings before installing anything new. Once you’ve found your sitemap, you can submit its address through Google Search Console. A sitemap helps Google discover pages, but it doesn’t guarantee that every page will be indexed or rank in search results.

What Is an XML Sitemap?

An XML sitemap is a file that lists important website addresses in a format search engines can understand. XML stands for Extensible Markup Language, which is simply a structured way of organising information so computer systems can read it.

Think of your sitemap as a directory of the pages you want search engines to know about. Rather than relying entirely on links between pages, search engines can use the sitemap to discover URLs that might otherwise be harder to find.

For example, a cleaning company’s sitemap might include its homepage, office cleaning page, carpet cleaning page, contact page and useful blog articles. The sitemap tells search engines that these URLs exist, although it doesn’t instruct Google to rank them or guarantee they will be indexed.

What Does an XML Sitemap Look Like?

When you open a sitemap in your browser, you may see a list of URLs surrounded by technical-looking tags. Some SEO plugins display a more readable table containing the page addresses and modification dates.

Don’t worry if the file looks unfamiliar. It’s designed primarily for search engines rather than human visitors, and you normally won’t need to edit the XML code yourself.

Is an XML Sitemap the Same as a Website Sitemap Page?

No. An XML sitemap is intended for search engine crawlers, while an HTML sitemap is an ordinary webpage containing links that visitors can follow. Both can be useful, but they serve different purposes.

For most small business websites, the XML sitemap is the one you’ll be checking and submitting through Google Search Console.

Why Does Your WordPress Website Need a Sitemap?

An XML sitemap helps search engines discover the important pages on your website. This can be particularly helpful if your website is new, has recently been redesigned or contains pages that aren’t easily discovered through internal links.

Google can discover pages without a sitemap by following links from other websites and from pages it already knows about. However, providing a sitemap gives Google another way to find the URLs you consider important.

A sitemap is especially useful when you publish new blog posts, add service pages or change the structure of your website. It can also provide additional information, such as when a page was last meaningfully modified, where supported.

However, an XML sitemap isn’t a replacement for good website navigation, useful content or technical SEO. A page listed in a sitemap can still be excluded from Google’s index if it has technical restrictions or Google decides not to index it.

How to Check Whether You Already Have an XML Sitemap

Before creating anything, check whether WordPress or an existing SEO plugin has already generated a sitemap. Many WordPress websites have this feature enabled automatically, so installing another plugin may be unnecessary.

Step-by-Step Instructions

  1. Open a new browser tab.
  2. Enter your website address followed by /wp-sitemap.xml.
  3. Press Enter and check whether a sitemap appears.
  4. If that doesn’t work, try /sitemap_index.xml.
  5. If a sitemap opens, check that the URLs belong to your website.
  6. Make a note of the working sitemap address.

For example, if your website address is https://example.co.uk, you could try https://example.co.uk/wp-sitemap.xml or https://example.co.uk/sitemap_index.xml.

If one address doesn’t work, it doesn’t automatically mean your website has no sitemap. Your SEO plugin may use a different location, or a caching or server configuration problem may be affecting the sitemap URL.

You can also check your website’s /robots.txt file, which sometimes includes a Sitemap directive pointing to the correct address.

How to Use WordPress’s Built-In XML Sitemap

Since WordPress 5.5, WordPress core has included basic XML sitemap functionality. On a standard installation where public sitemap generation is enabled, WordPress automatically creates a sitemap without requiring a separate plugin.

The usual address is /wp-sitemap.xml. This is a sitemap index that links to smaller sitemaps containing different types of content, such as posts, pages and other supported public content.

Step-by-Step Instructions

  1. Check that your WordPress installation is reasonably up to date.
  2. Log in to your WordPress dashboard.
  3. Go to Settings > Reading.
  4. Check the Search Engine Visibility setting.
  5. For a public website intended to appear in search, ensure Discourage search engines from indexing this site isn’t selected.
  6. Open yourwebsite.co.uk/wp-sitemap.xml in a browser.
  7. Review the available sitemap links.

If the sitemap opens successfully, you already have a basic XML sitemap. You don’t need to create another one simply because someone has recommended using an SEO plugin.

WordPress core doesn’t provide the same range of sitemap controls as dedicated SEO plugins. If your website already uses Rank Math or Yoast SEO, that plugin may manage the sitemap instead.

How to Create an XML Sitemap With Rank Math

Rank Math is a WordPress SEO plugin that can generate XML sitemaps and provide controls over which content types are included. If Rank Math is already installed, it’s usually sensible to check its existing sitemap settings rather than introduce another sitemap tool.

Step-by-Step Instructions

  1. Log in to your WordPress dashboard.
  2. Open Rank Math SEO > Dashboard.
  3. Make sure the Sitemap module is enabled, if your version displays this module.
  4. Open Rank Math SEO > Sitemap Settings.
  5. Find the main sitemap configuration options.
  6. Review which post types and taxonomies are included.
  7. Save any necessary changes.
  8. Open your sitemap, normally at /sitemap_index.xml.

Rank Math can generate separate sitemaps for pages, posts and other supported content types. You may also find options for excluding particular content or controlling how many URLs appear in individual sitemap files.

For an ordinary small business website, the most important thing is to ensure that your main public pages and useful articles are included, while pages deliberately excluded from indexing are handled appropriately.

What If the Rank Math Sitemap Doesn’t Open?

First check that the sitemap feature is enabled and that your website’s permalink settings are working correctly. If you encounter a 404 error, Rank Math’s troubleshooting guidance may recommend refreshing WordPress rewrite rules by saving the permalink settings without changing the permalink structure.

However, don’t change the actual permalink format just to repair a sitemap. Changing established URLs can affect links and search visibility if redirects aren’t handled correctly.

How to Create an XML Sitemap With Yoast SEO

Yoast SEO also includes automatic XML sitemap generation. On many WordPress websites using Yoast, the sitemap is already active and simply needs to be checked rather than created manually.

Step-by-Step Instructions

  1. Log in to your WordPress dashboard.
  2. Open Yoast SEO > Settings.
  3. Find the Site features section.
  4. Look for the XML sitemaps feature.
  5. Make sure it is enabled.
  6. Save the settings if you’ve made a change.
  7. Open the sitemap link provided by Yoast, normally /sitemap_index.xml.

Yoast automatically manages its sitemap based on your content and indexing settings. Pages that have been excluded from search results through noindex instructions are generally excluded from the XML sitemap too.

If you can’t find the settings in exactly the same place, check your Yoast version and the plugin’s current documentation. WordPress plugin interfaces can change over time.

Should You Use Rank Math and Yoast Together?

No. Both plugins provide overlapping SEO functions, including sitemap generation. Running them together can create conflicting settings and make it harder to identify which plugin is controlling your website’s SEO information.

If your website already uses one of these plugins successfully, there’s usually no need to install the other just to generate a sitemap.

Which Pages Should Be Included in Your Sitemap?

Your XML sitemap should generally contain the important canonical URLs that you want search engines to consider for indexing. These are normally public pages that load correctly and provide useful information.

Page TypeUsually Include?Reason
HomepageYesRepresents the main entry point to your website.
Main service pagesYesHelp search engines discover your services.
Useful blog postsYesProvide information relevant to potential visitors.
About and contact pagesUsuallyProvide useful business and contact information.
Relevant category pagesDependsInclude them when they are intended to be indexed and provide value.
Privacy and legal pagesDependsThese pages should remain accessible, but sitemap inclusion depends on indexing decisions.
Thank-you pagesUsually noOften intended only for visitors who complete a form or purchase.
Duplicate or redirected URLsNoPrefer the correct canonical destination URL.
Pages marked noindexNoThey aren’t intended to be indexed.

Don’t assume every URL generated by WordPress belongs in your sitemap. Some websites create archives, attachment pages and other URLs that don’t need separate indexing.

The objective is to help search engines discover the pages that matter, not to submit the largest possible number of URLs.

How to Submit Your XML Sitemap to Google

Once you’ve found your XML sitemap and checked that it’s working, you can submit it through Google Search Console. This tells Google where the sitemap is located so it can retrieve the information.

Step-by-Step Instructions

  1. Visit Google Search Console.
  2. Sign in using the Google account associated with your website.
  3. Select your verified website property.
  4. Click Sitemaps in the left-hand menu.
  5. Find the Add a new sitemap field.
  6. Enter the sitemap path or URL as requested by the interface.
  7. Click Submit.
  8. Review the sitemap submission status.

For example, if your sitemap is located at https://example.co.uk/sitemap_index.xml, you would submit that sitemap address using the field provided.

If Google reports that the sitemap has been submitted successfully, it means Google has accepted the submission for processing. It doesn’t mean every page has already been indexed.

Do You Need to Submit Every Sitemap File?

Normally, no. If your SEO plugin generates a sitemap index that links to smaller sitemaps, you can submit the main index file. Google can then discover the child sitemaps referenced within it.

How to Check Whether Your Sitemap Is Working

After submitting your sitemap, check both the sitemap itself and the information reported by Google Search Console. A sitemap that opens in your browser is a useful starting point, but it’s not the only check worth making.

What to Look For

  1. The sitemap URL opens without a 404 or server error.
  2. The file contains URLs belonging to the correct website.
  3. Important public pages are included where appropriate.
  4. Unwanted noindex and redirected URLs aren’t being submitted.
  5. Google Search Console can retrieve the sitemap.
  6. There are no unresolved sitemap processing errors.

If Search Console reports a successful sitemap submission but a particular page isn’t indexed, inspect that page separately using the URL Inspection tool.

Remember that a sitemap is mainly a discovery tool. It doesn’t override indexing instructions, repair broken pages or force Google to include content in its search results.

Common WordPress XML Sitemap Problems

My Sitemap Shows a 404 Page Not Found Error

A 404 error may indicate that the sitemap URL is incorrect, the sitemap feature is disabled or WordPress rewrite rules aren’t working as expected. Check your existing SEO plugin settings first and confirm you’re using the correct sitemap address.

If the problem began after a plugin update or website migration, ask your website provider to check the configuration rather than changing established permalink structures without understanding the consequences.

My Sitemap Is Blank or Displays an Error

A blank sitemap or XML error can sometimes result from plugin conflicts, unexpected output, server problems or caching issues. Check whether the website is otherwise functioning normally and whether your SEO plugin reports a sitemap problem.

Don’t edit core WordPress files to try to fix the issue. If the cause isn’t obvious, a WordPress professional can investigate the generated XML response and server configuration.

Some of My Pages Are Missing From the Sitemap

First check whether the missing pages are published and intended to be indexed. Then review the relevant sitemap settings and any noindex instructions applied through your SEO plugin.

If the page is deliberately excluded from search results, its absence from the sitemap may be correct. If it’s an important public service page, investigate why it isn’t being included.

Google Says It Couldn’t Fetch My Sitemap

Check that the sitemap URL is correct and publicly accessible. A temporary server problem, access restriction or incorrect response can prevent Google from retrieving it.

Open the sitemap in a private browser window and review the error in Search Console. If the problem continues, ask your hosting provider or website developer to check the server response and crawler access.

My Sitemap Contains Old Website Addresses

This can happen after a domain change, migration or incorrect website URL configuration. Check Settings > General to confirm your WordPress Address and Site Address are correct, but don’t change them casually.

Incorrectly changing these addresses can make your website inaccessible. If your sitemap contains URLs from an old domain, investigate the migration and SEO plugin configuration before making changes.

Does Your Sitemap Update Automatically?

In most cases, yes. WordPress’s built-in sitemap and the sitemaps generated by Rank Math and Yoast SEO are designed to reflect changes to eligible published content automatically.

When you publish a new page or blog post, the sitemap should normally update to include it if the page meets the relevant inclusion rules. If you delete a page or mark it noindex, it may be removed from the sitemap.

You generally don’t need to create a new sitemap or submit it again every time you publish an article. However, it is worth checking your sitemap occasionally, particularly after website migrations, SEO plugin changes or technical problems.

If you’re using caching software, an old cached response can sometimes make a sitemap appear out of date. Check the actual sitemap output before assuming the sitemap generator has stopped working.

Expert Insight From Daren Ward

Daren Ward, Founder of A to Z Website Solutions
Daren Ward

Having worked in website design and online marketing since 2004, my advice is to check what your WordPress website is already doing before installing another plugin. I’ve seen websites where several plugins have been added over time to perform jobs that WordPress or an existing plugin can already handle. This can make website management more complicated than it needs to be.

For a small business, I’d focus on whether the sitemap includes the pages that could actually help bring in enquiries. Your main services, useful information pages and important blog articles should be easy for search engines to discover. But simply having a sitemap doesn’t mean those pages are well written, properly linked or ready to compete in Google.

I’d also recommend checking Google Search Console after submitting your sitemap. If a valuable service page isn’t indexed, don’t keep resubmitting the sitemap and hoping for a different result. Inspect the individual page, identify the problem and deal with it properly. A sitemap is one useful part of SEO, but the quality and accessibility of your website still matter.

Important Warning Before Changing Sitemap Settings

Don’t install multiple SEO plugins or change advanced sitemap settings without checking your website’s existing configuration. WordPress may already generate a sitemap, and your current SEO plugin may be managing it correctly.

Be especially careful when changing noindex settings, canonical URLs, redirects or permalink structures. These settings affect more than the sitemap and can change how search engines access or interpret your pages.

If your website has recently been redesigned or moved to another domain, take a full backup before making technical changes. If you’re unsure why certain pages are excluded, investigate the reason rather than adding every available URL to the sitemap.

Action Checklist: Create and Check Your WordPress XML Sitemap

  1. Check for an existing sitemap. Try the common WordPress and SEO plugin sitemap addresses.
  2. Identify your SEO plugin. See whether Rank Math, Yoast SEO or another tool is already managing your sitemap.
  3. Confirm the sitemap works. Open it in your browser and check that it displays correctly.
  4. Review important URLs. Make sure your homepage, service pages and useful articles are included where appropriate.
  5. Check excluded content. Confirm that noindex, redirected and unwanted duplicate URLs aren’t being submitted.
  6. Check WordPress visibility. Make sure your public website isn’t accidentally discouraging indexing.
  7. Open Google Search Console. Select your verified website property.
  8. Submit the sitemap. Enter the correct sitemap address and review the response.
  9. Investigate errors. Correct any sitemap access or processing problems reported.
  10. Monitor important pages. Use URL Inspection to check individual indexing issues rather than assuming sitemap submission guarantees indexing.

Frequently Asked Questions

1. Does WordPress automatically create an XML sitemap?

Yes. WordPress has included basic XML sitemap functionality since version 5.5. On most standard public installations, the sitemap is available at /wp-sitemap.xml. If you use an SEO plugin such as Rank Math or Yoast SEO, the plugin may generate its own sitemap instead.

2. Do I need a plugin to create an XML sitemap in WordPress?

Not necessarily. Modern WordPress installations already include basic sitemap generation. An SEO plugin can provide additional controls over which content is included, but you shouldn’t install one solely for sitemap creation without first checking what your website already provides.

3. Where can I find my WordPress XML sitemap?

Try adding /wp-sitemap.xml or /sitemap_index.xml to your website address. The first is the standard WordPress core sitemap location, while the second is commonly used by Rank Math and Yoast SEO. Your configuration may use a different address.

4. Is an XML sitemap necessary for Google indexing?

No. Google can discover and index webpages without an XML sitemap by following links. However, a sitemap can make discovery easier, particularly for new websites, larger websites and pages that are harder to find through normal navigation.

5. Will submitting a sitemap make my website rank higher on Google?

Submitting an XML sitemap doesn’t directly improve Google rankings or guarantee indexing. It helps Google discover URLs. Search visibility also depends on relevant content, accessibility, technical quality and other factors that influence how Google processes and ranks pages.

6. How often should I update my XML sitemap?

Normally, you don’t need to update it manually. WordPress and popular SEO plugins automatically reflect changes to eligible published content. It’s still sensible to check the sitemap after significant website changes, migrations or plugin configuration updates.

7. Should every WordPress page appear in my XML sitemap?

No. Your sitemap should generally contain important canonical pages intended for indexing. Redirected URLs, pages marked noindex and unnecessary duplicates normally shouldn’t be included. Some pages may remain useful to visitors without needing to appear in search results.

8. Why is my WordPress XML sitemap showing a 404 error?

A 404 error may occur because the sitemap address is incorrect, sitemap generation is disabled or the website’s rewrite rules aren’t working correctly. Check your SEO plugin settings and the correct sitemap location before changing technical website settings.

9. Can I submit my XML sitemap to Bing as well as Google?

Yes. You can submit your XML sitemap through Bing Webmaster Tools as well as Google Search Console. Both services can use sitemap information to discover URLs, although neither guarantees that every submitted page will be indexed.

10. What should I do if Google accepts my sitemap but doesn’t index some pages?

Use Google Search Console’s URL Inspection tool to investigate the individual pages. Check for noindex instructions, technical errors, duplicate content and other possible causes. A successful sitemap submission means Google can process the sitemap, not that every URL will automatically appear in search results.

Summary

Creating an XML sitemap in WordPress is usually straightforward because modern WordPress installations already provide basic sitemap functionality. If your website uses Rank Math or Yoast SEO, your sitemap may already be generated and managed automatically by the plugin.

Start by finding your existing sitemap rather than installing another tool. Check that it contains the important public pages you want search engines to discover, then submit the sitemap through Google Search Console. Once it’s working, you normally won’t need to recreate it every time you publish something new.

Remember that a sitemap helps search engines find URLs but doesn’t guarantee indexing or higher rankings. Your website still needs useful content, clear navigation, appropriate indexing settings and pages that work correctly for visitors and search engines.

Getting Further Help

If you’re unsure whether your WordPress sitemap is working correctly or important pages aren’t appearing on Google, you can explore the SEO and AI Visibility service from A to Z Website Solutions. Professional support can help identify sitemap, indexing and technical SEO problems that may be affecting your website’s visibility.

Key Takeaways

  • WordPress includes built-in XML sitemap functionality.
  • Rank Math and Yoast SEO can automatically generate and manage XML sitemaps.
  • An XML sitemap helps search engines discover important website URLs.
  • You can submit your sitemap through Google Search Console.
  • Important public, indexable pages should generally be included.
  • Redirected, noindex and unnecessary duplicate URLs should normally be excluded.
  • Most WordPress sitemaps update automatically when eligible content changes.
  • Submitting a sitemap doesn’t guarantee Google indexing or higher search rankings.

Found This Helpful? Share It

If you found this article useful, please share it with other business owners who might find it helpful too.

A quick share on LinkedIn, Facebook or your favourite social platform could help someone else find the advice they need.

Email

Client Login