Sitemaps are one of SEO's oldies but goodies.

In fact, they're one of the most important elements of SEO, because they help Google and other search engines find the pages on your website.

Not to mention they also help you rank better, because Google is able to locate new pages and identify updates to old pages much more quickly.

In a nutshell: you can't live without 'em.

I've often heard that they can feel overwhelming and quite technical to understand.

But don't let the frustration of their technicality make you throw your computer out the window — I've got your back!

我将向您展示什么是站点地图,如何创建一个站点,如何将其提交给Google以及所有基本的最佳实践。

→ Download Now: SEO Starter Pack [Free Kit]

What is a sitemap?

To start off with the basics, asitemapis a file that provides information about the pages, videos, images, and other files on your website. It's important for various reasons, including:

  • 作为谷歌和其他搜索路线图gines to find and better understand your content.
  • Leading search engines through your website to crawl and index the essential pages.
  • Helping search identify when new pages and updates to old pages are available.
  • Helping search engines find alternate language versions of your page.

But before I go further, you must know that there are two types of sitemap formats: HTML and XML. Here's the basic difference:

HTML sitemaps:This is more like your content sitemap that users can see and use to navigate your site. They're also commonly referred to as your "website archive." Some marketers view HTML sitemaps as outdated or even entirely unnecessary.

XML站点地图:这是纯用于索引和爬行网站的站点地图,并已手动提交。这是处理如何在网站上存储所有内容的更现代形式。

While HTML sitemaps might help users find pages on your site, asJohn Mueller said, your internal linking should take care of that anyways. So the focus from an SEO perspective should be on XML sitemaps.

Types of Sitemaps

From these two types of sitemaps described above, there are also subsections within them. I'll now go over these in more detail.

1. Page Sitemap

页面站点或regular站点地图改进页面和帖子的索引。对于非注重图像或视频为中心的网站,例如摄影和摄影网站,页面站点地图还可以在每个页面上包括图像和视频。

A page sitemap without an image would look like this:

<?xml版本=“ 1.0” encoding =“ utf-8”?>

https://example.com/

2020-09-17

daily

0.9

Include your URLs in tags. indicates when the page was last edited. indicates how often the page is edited and indicates how important the page is to other pages on the website as a whole. You can take a look atSitemaps XML format有关这些参数的更多信息。

2. Video Sitemap

An XML video sitemap is similar to a page sitemap, but of course focuses largely on video content, which means they are only necessary if videos are critical to your business. If they aren't, save yourcrawl budget(the finite amount of crawlable pages and resources across your site) and add the video link to your page sitemap.

But if you do need a video sitemap, it would look like this:

Note: This is what a video sitemap looks like. Implement it only if videos are critical to your business.

3. News Sitemap

如果您发布新闻,并想获得这些新bob官网官方网站闻报道和Google News中的特色,则需要新闻站点地图。这里有一个至关重要的规则:不包括发表的文章,这些文章比文件中的最后两天更长。

Google News sitemaps aren't favored in regular ranking results, so make sure you only add news articles. Also, they do not support image links, so Google recommends you use structured data to specify your article thumbnail.

4. Image Sitemap

Like the video sitemaps, image sitemaps are only necessary if images are critical to your business, such as a photography or stock photo site. If they aren't, you can leave them in your page sitemap and mark them up with the image object schema, and they will be crawled along with the page content/URL.

If you believe an image sitemap is needed, it will look like this:

<?xml版本=“ 1.0” encoding =“ utf-8”?>

https://example.com/

<图像:图像>

<图片:loc> https://example.com/image-url.png

<图像:图像>

https://example.com/second-image-url.png

5. Sitemap Index

There are a few limitations you'll want to keep in mind for sitemaps:

  • Having too many URLs will only lead to no indexation of some of your pages.
  • 除了新闻站点地图外,所有站点地图都应具有50,00bob官网官方网站0个URL。
  • bob官网官方网站新闻站点地图应have a maximum of 1000 URLs.
  • A sitemap should be a maximum of 50MB in uncompressed file size.

As a result of those limitations, you might need to have more than one sitemap. When you use more than one sitemap file, you need an index file that lists all of those sitemaps. It's the index file that you submit in Google Search Console and Bing Webmaster Tools. That file should look like this:

XML站点地图示例

到目前为止,您已经看到了每个站点地图的结构。大多数网站只需要每个页面上包含图像的页面站点地图。看起来这样:

Sitemap Priorities

Adding priorities to your sitemapis one of the things many people do to differentiate between how important different pages are, but Google's Gary Illyes mentioned that Google ignores these priorities. In his exact words:

Generally speaking, as long as you are honest about when your content was actually modified, include it in your sitemap so that Google and other search engines know to re-crawl the modified page and index the new content.

How to Create a Sitemap

In this section, I will show you how to create a sitemap without using any generator or plugin. If your website is on WordPress or you'd rather use a generator (which makes this easy), skip to the next section.

These are the exact steps to follow to create a sitemap manually:

1. Decide which pages on your site should be crawled by Google, and determine thecanonical versionof each page.

Canonical versions are necessary when you have duplicate pages. For example, suppose you serve an international community and have pages for each location with the same language and content, likeexample.com/us/pageexample.com/ca/pagefor US and Canada visitors, respectively.

在这种情况下,重要的是要指出原始example.com/page orone of the two作为规范。如果您想了解更多有关此方法的工作方式,那么文章解释规范化in depth.

Furthermore, do not include URLs that are blocked by robots.txt files, require a login to access, or are password-protected, as search bots can't crawl them. You'll only get coverage errors in GSC if you add them.

2. Determine if you need more than one sitemap.

Several websites use separate files for pages, posts, and categories. Remember that if you have more than 50,000 URLs, you need multiple sitemaps.

3. Code all your URLs in XML tags to look like the type of sitemap you want to create.

This页面说明如何使用XML标签in further detail.

4. If you have multiple sitemap files, create a sitemap index file and include the links to the individual sitemaps you created.

This one is already described in the section titled "Sitemap Index".

Sitemap Generators

Most of us marketers do not have a web development background, so we can't code to save our lives. If the thought of manually crafting a sitemap gives you a headache, use a sitemap generator and save yourself 12 days of looking through complex coding.

There are severalsitemap generatorsthat you can use:

  • TechnicalSEOby Merkle has one where you can upload a CSV file with your URLs. It's especially great if you have different language versions of your pages (hreflang tags).If your website is custom-coded and is not on any CMS or builder that generates a sitemap, you need to use a generator like TechnicalSEO.
  • Screaming Frog SEO Spideralso has one that I like to use with simple custom-built sites. In Screaming Frog, ensure you are using the spider mode. You can do that by clicking on "Mode" and selecting "spider". Then type the URL of your home page and let it crawl. When it's done, click on "Sitemaps."

为澄清何w to use Screaming Frog, take a look at the image below:

In order to save the XML file to your computer, tick all the options that matter to your site and click on "export". Then, upload that file to your server in the root directory.

这两个工具均未自动更新SiteMap文件。有些工具确实是优质的,因此您为这项服务付费。

但是,如果您的网站在WordPress或Shopify等电子商务平台上,则无需处理以上任何一个。

For WordPress sites,Yoast排名数学are popular SEO plugins that generate sitemaps and update them when you edit your posts and pages and Shopify even generates sitemaps automatically.

How to Submit Your Sitemap to Google

将您的站点地图提交给Google的最佳方法是通过Google Search Console(GSC)。还有其他方法和其他步骤,但是我将从GSC开始,因为这是最常见的方法。

Follow these steps:

1. Go to Google Search Console and click on "sitemap."

2. Type your sitemap URL and click Submit. If you have multiple sitemaps with a sitemap index file, you only need to type the URL for the index file.

As an alternative, if you haven't submitted it to GSC, there is another way to let Google know you have one by adding this line in your robots.txt:

Sitemap: http://example.com/sitemap.xml

But of course the URL here with the one you actually have. And if you have an index file, include only your index file here.

If (for some weird reason) you aren't using GSC, use the ping service to let Google know it should crawl your file. To do that, type the URL below in your browser:

http://www.google.com/ping?sitemap=https://example.com/sitemap.xml

Replacehttps://example.com/sitemap.xmlwith your sitemap URL.

And it's done!

Sitemap Best Practices

现在,您了解了站点地图的重要性,它们的工作方式以及提交它们的选择,请确保您创建的最后一个通过遵循这些最佳实践来保持尖端形状。

1. Use tools to generate automatic sitemaps.

Manually creating and updating an XML sitemap will cost you a lot of time (and is unnecessarily complex). To save time so you can focus on other things like your next Netflix binge, it's best to use an automatic sitemap generator.

上面提到的WordPress提到的功能免费提供。对于定制的网站,您必须付款,但我认为这绝对是值得付出的。

2. Do regular sitemap maintenance checks and updates.

All parts of SEO are an ongoing effort, so check your sitemaps regularly. Search console does an excellent job of letting you know if your submitted URLs have issues with crawling or indexing.

Check the 'Coverage' section in GSC regularly and update your site or sitemap when there are errors. The great thing about this is that it tells you what the exact error is with suggestions on how to fix it.

You can also use Screaming Frog for sitemap maintenance. After crawling your website or sitemap URL, check the response code tab for 404 or 5xx errors.

If you are using an automatic sitemap generator tool or plugin, update it when updates are available. Furthermore, periodically view the sitemap by going to your sitemap URL and checking if any page is missing or the last updated time is incorrect.

3. Prioritize high-quality pages in your sitemap.

Although Google no longer pays attention to the priority tag (or so they say), you can still add it because there's more than Google out there (yes, as an SEO I will admit it). Bing might pay attention to that tag, so it's still good practice to prioritize high-quality pages in your sitemap.

Sitemap priority shows which pages to crawl and index faster, so you can set priorities using values ranging from 0.00 to 1.00. But make sure not to use the same value for all pages or else Google won't be able to tell which is most important.

For values, you can go with something like this:

  • Homepage - 1.00
  • 主要着陆页-0.90
  • 其他着陆页-0.85
  • 导航栏上的主要链接-0.80
  • Other pages on site - 0.75
  • Top articles/blog posts like hub pages - 0.80
  • 博客类别页-0.75
  • Other posts - 0.64

4. Include only canonical versions of URLs in your sitemap.

Your sitemap should only contain URLs that you want search engines to index. That means if a URL points to another as itscanonical version, you shouldn't include it, as it's a statement to Google and other search engines that you don't wish for that URL to be indexed.

Ignoring that and including that URL in your sitemap provides conflicting information to Google. The unintended URL might get indexed, or you will get coverage errors in GSC. So, only include the canonical versions, so you can consolidate your position in search engine results.

5. Split up your large sitemaps.

我已经在上面提到过,如果超过50MB或超过50,000个URL,则需要将站点地图分为多个文件。永远不要提交大XML filesto Google, otherwise some of your URLs will not be indexed - and you know well that every URL matters!

One quick tip here is to save each file with easy to understand names (for you) like page_sitemap1.xml and page_sitemap2.xml.

And with that, I wish you happy sitemapping!

Click here to get everything you need to get your website ranking in search.

marketing

最初出版于2021年6月30日7:00:00 AM,更新于2021年6月30日

Topics:

Technical SEO