XML Sitemap: What It Is & How to Generate One

1 month ago 10
ARTICLE AD BOX

What Is an XML Sitemap?

An XML sitemap is simply a record that tells hunt engines similar Google which URLs connected your website should beryllium indexed (added to its database of imaginable hunt results).

It whitethorn besides supply further accusation astir each URL, including:

  • When the leafage was past modified
  • How often the leafage is updated
  • The comparative value of the page

This accusation tin assistance hunt engines crawl (explore) your tract much efficaciously and efficiently. And amended lucifer your pages with applicable hunt queries.

That’s wherefore XML sitemaps are important successful search motor optimization (SEO).

What Does an XML Sitemap Look Like?

An XML sitemap (or sitemap.xml file) looks thing similar this:

Nested xml tags that see  information  astir  assorted  URLs connected  a java  website

It’s called an XML sitemap due to the fact that it’s written successful Extensible Markup Language (XML). 

If you’re funny successful the details, the main tags utilized are:

  • <urlset>: Encloses each the tags for each sitemap
    • <url>: Encloses each the tags for each URL
      • <loc>: Specifies the page’s implicit URL
      • <lastmod>: Specifies erstwhile the leafage was past updated (optional) 
      • <changefreq>: Specifies however often the leafage is apt to alteration (optional) 
      • <priority>: Specifies the comparative value of the leafage from 0.0 to 1.0 (optional) 

Webmasters tin besides make dedicated image, video, and quality sitemaps. To assistance hunt engines recognize these circumstantial types of content.

If you request to make much than 1 sitemap, you request a sitemap index. Which fundamentally acts arsenic a sitemap for your sitemaps.

Do You Need an XML Sitemap?

An XML sitemap is highly recommended if you privation your pages to amusement successful hunt motor results.

If you don’t supply an XML sitemap, hunt engines person to trust connected hyperlinks (on your ain tract oregon elsewhere) to observe pages connected your site. This is inefficient and it tin pb to pages being missed.

Now, let’s larn however to make an XML sitemap.

How to Generate an XML Sitemap

It’s apt that the level you usage to negociate your website’s contented automatically generates and updates your XML sitemap. 

You whitethorn beryllium capable to find yours by going to yourdomain.com/sitemap.xml successful your browser.

Like this:

The webpage for semrush.com/sitemap.xml showing an XML sitemap

(This should enactment if you’re utilizing WordPress, Wix, Squarespace, oregon Shopify.)

Otherwise, notation to the assistance halfway for your website builder oregon contented absorption strategy (CMS). Or interaction your platform’s enactment team.

If your level doesn’t supply an XML sitemap, you tin usage a sitemap generator tool

These tools tin besides beryllium adjuvant if you privation much power implicit your sitemap. For example, you tin customize your WordPress sitemap with the Yoast SEO plugin.

If you usage a instrumentality extracurricular of your level to make a sitemap, marque definite to people it to your tract to marque it live.

How to Submit Your XML Sitemap to Google

It’s champion signifier to submit your sitemap to Google. (Rather than waiting for Google’s website crawlers to observe the record connected their own.)

But first, marque definite determination are nary issues with your XML sitemap.

With Semrush’s Site Audit tool, you tin cheque whether your sitemap.xml file:

  • Can’t beryllium found
  • Has formatting errors
  • Contains non-canonical oregon non-200 URLs
  • Isn’t specified successful robots.txt
  • Is excessively large
  • Contains HTTP alternatively than HTTPS URLs

The instrumentality besides checks whether your SEO sitemap contains orphaned pages—URLs that aren’t linked to from anyplace connected your site. (It’s champion signifier to adhd internal links to pages that should beryllium indexed.)

Simply spell to the “Issues” study aft mounting up your audit. And participate “sitemap” into the hunt bar.

Results for "sitemap" successful  Site Audit "Issues" report

If the instrumentality flags an error, warning, oregon notice, you tin work “Why and however to hole it.”

Rerun the audit aft implementing immoderate fixes. So you tin cheque they’re moving correctly.

“Rerun campaign” fastener  successful  Site Audit

When you’re blessed with your sitemap audit, sign into Google Search Console

And spell to “Indexing” > “Sitemaps.”

“Indexing” > “Sitemaps" buttons successful  Google Search Console

Enter your sitemap’s URL into the “Add a caller sitemap” section.

And click “Submit” erstwhile you’re done.

URL entered into the “Add a caller   sitemap” section

You should past spot your record successful the “Submitted sitemaps” section.

When Google has crawled your sitemap, you’ll spot a “Success” announcement successful the “Status” column.

“Success” announcement  successful  the “Status” file  nether  “Submitted sitemaps” section

Google volition periodically re-crawl your SEO sitemap to cheque for immoderate changes.

But if you marque large changes that you privation to beryllium discovered quickly, you tin re-submit your sitemap with a caller request.

XML Sitemap Best Practices

If you’re utilizing a sitemap.xml record generated by your website level oregon a specialized tool, it’ll astir apt conscionable XML sitemap champion practices.

But if you privation to marque sure, work and recognize these guidelines.

First, your sitemap should lone notation URLs that:

  • You privation to beryllium indexed. For example, you shouldn’t see pages from your staging environment. Or the URL for an bid confirmation page.
  • Return a 200 presumption code. You shouldn’t effort to scale pages that instrumentality different http presumption codes. Such arsenic 301 redirects (which bespeak imperishable redirects) oregon 404 errors (which bespeak a leafage can’t beryllium found).
  • Are afloat qualified and absolute. In different words, marque definite to specify the full URL with the scheme, authority, and path (e.g., “https://www.semrush.com/blog/”).
  • Are canonicals. Canonical URLs correspond the sole mentation of a leafage oregon the superior mentation of a duplicated page. 

And your sitemap record should:

  • Be UTF-8 encoded. This is simply a strategy that ensures hunt engines tin recognize each the characters you’re using. For example, you’ll request to usage “&” successful spot of a “&” symbol.
  • Be little than 50MB oregon 50,000 URLs. If necessary, you tin make aggregate sitemaps and a sitemap scale file.
  • Specify the close namespace. A namespace is similar a statement that tells the hunt motor what kinds of rules the sitemap follows. Most sitemaps usage the “http://www.sitemaps.org/schemas/sitemap/0.9” namespace to amusement that the record conforms to standards acceptable by sitemaps.org.
  • Include connection and portion variants for each URL (where applicable). You tin larn much successful this assets from Google.

Lastly, marque definite to nexus to your sitemap from your robots.txt file. This is simply a website record that tells hunt engines which pages they should and shouldn’t crawl.

Ensure Your SEO Sitemap Is Up to Code

With Semrush’s Site Audit, you tin easy cheque for issues related to your XML sitemap.

The instrumentality besides checks for dozens of different issues that tin harm your SEO results.

Create your escaped Semrush relationship and spot what needs fixing connected your site.