分享好友 最新动态首页 最新动态分类 切换频道
XML Sitemap: What It Is & How to Generate One
2024-12-26 11:55

An XML sitemap is a file that tells search engines like Google which URLs on your website should be indexed (added to its database of possible search results).

XML Sitemap: What It Is & How to Generate One

It may also provide additional information about each URL, including:

  • When the page was last modified
  • How often the page is updated
  • The relative importance of the page

This information can help search engines crawl (explore) your site more effectively and efficiently. And better match your pages with relevant search queries.

That’s why XML sitemaps are important in search engine optimization (SEO).

An XML sitemap (or sitemap.xml file) looks something like this:

If you’re interested in the details, the main tags used are:

  • <urlset>: Encloses all the tags for each sitemap
    • <url>: Encloses all the tags for each URL
      • <loc>: Specifies the page’s complete URL
      • <lastmod>: Specifies when the page was last updated (optional) 
      • <changefreq>: Specifies how frequently the page is likely to change (optional) 
      • <priority>: Specifies the relative importance of the page from 0.0 to 1.0 (optional) 

Webmasters can also create dedicated image, video, and news sitemaps. To help search engines understand these specific types of content.

If you need to create more than one sitemap, you need a sitemap index. Which essentially acts as a sitemap for your sitemaps.

An XML sitemap is highly recommended if you want your pages to show in search engine results.

If you don’t provide an XML sitemap, search engines have to rely on hyperlinks (on your own site or elsewhere) to discover pages on your site. This is inefficient and it can lead to pages being missed.

Now, let’s learn how to create an XML sitemap.

It’s likely that the platform you use to manage your website’s content automatically generates and updates your XML sitemap. 

You may be able to find yours by going to yourdomain.com/sitemap.xml in your browser.

Like this:

Otherwise, refer to the help center for your website builder or content management system (CMS). Or contact your platform’s support team.

If your platform doesn’t provide an XML sitemap, you can use a sitemap generator tool. 

These tools can also prove helpful if you want more control over your sitemap. For example, you can customize your WordPress sitemap with the Yoast SEO plugin.

If you use a tool outside of your platform to create a sitemap, make sure to publish it to your site to make it live.

It’s best practice to submit your sitemap to Google. (Rather than waiting for Google’s website crawlers to discover the file on their own.)

But first, make sure there are no issues with your XML sitemap.

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

  • Can’t be found
  • Has formatting errors
  • Contains non-canonical or non-200 URLs
  • Isn’t specified in robots.txt
  • Is too large
  • Contains HTTP rather than HTTPS URLs

The tool also checks whether your SEO sitemap contains orphaned pages—URLs that aren’t linked to from anywhere on your site. (It’s best practice to add internal links to pages that should be indexed.)

Simply go to the “Issues” report after setting up your audit. And enter “sitemap” into the search bar.

Rerun the audit after implementing any fixes. So you can check they’re working correctly.

And go to “Indexing” > “Sitemaps.”

And click “Submit” when you’re done.

When Google has crawled your sitemap, you’ll see a “Success” notice in the “Status” column.

But if you make major changes that you want to be discovered quickly, you can re-submit your sitemap with a new request.

If you’re using a sitemap.xml file generated by your website platform or a specialized tool, it’ll probably meet XML sitemap best practices.

But if you want to make sure, read and understand these guidelines.

First, your sitemap should only reference URLs that:

  • You want to be indexed. For example, you shouldn’t include pages from your staging environment. Or the URL for an order confirmation page.
  • Return a 200 status code. You shouldn’t attempt to index pages that return other http status codes. Such as 301 redirects (which indicate permanent redirects) or 404 errors (which indicate a page can’t be found).
  • Are fully qualified and absolute. In other words, make sure to specify the entire URL with the scheme, authority, and path (e.g., “https://www.semrush.com/blog/”).
  • Are canonicals. Canonical URLs represent the sole version of a page or the primary version of a duplicated page. 

And your sitemap file should:

  • Be UTF-8 encoded. This is a system that ensures search engines can understand all the characters you’re using. For example, you’ll need to use  (without the space) in place of a "&" symbol.
  • Be less than 50MB or 50,000 URLs. If necessary, you can create multiple sitemaps and a sitemap index file.
  • Specify the correct namespace. A namespace is like a label that tells the search engine what kinds of rules the sitemap follows. Most sitemaps use the “http://www.sitemaps.org/schemas/sitemap/0.9” namespace to show that the file conforms to standards set by sitemaps.org.
  • Include language and region variants for each URL (where applicable). You can learn more in this resource from Google.

Lastly, make sure to link to your sitemap from your robots.txt file. This is a website file that tells search engines which pages they should and shouldn’t crawl.

With Semrush’s Site Audit, you can easily check for issues related to your XML sitemap.

The tool also checks for dozens of other issues that can harm your SEO results.

最新文章
7723游戏盒APP下载
7723游戏盒是一款手机游戏下载工具软件,具有手机游戏免费下载和社交互动功能。在这里你可以看到各类游戏排行榜单,支持一键快速下载,为广大玩家带来了便于了解手游信息的平台。玩家在这里下载游戏,UP上传游戏,对游戏发表评价,和社区其
2014年手机游戏排行榜大全 经典手游推荐榜单
大家都知道过去的时间里都出过什么全网爆火的游戏吗,不知大家是否还能叫得出它们的名字。很多都玩家让小编推一下过去很火的游戏,于是这期2014年手机游戏排行榜的介绍文章就出来了,以下的五款手游,全部都是在14年火遍大街小巷,引得众多
AI语音人工智能:探索未来的交互方式
随着人工智能(AI)的不断发展,AI语音技术正成为人们生活中不可或缺的一部分。AI语音人工智能能够模仿、理解和生成人类的语音,以及与人类进行自然而流畅的对话。这种技术的应用范围非常广泛,涉及手机助手、智能音箱、智慧家居、医疗保健
2025广东选调生报名推荐表填写模板_河源市东源县新港镇人民政府一级主任科员以下岗位已有0人报名
  广东选调生考试网提供以下选调生选调生信息:2025广东选调生报名推荐表填写模板_河源市东源县新港镇人民政府一级主任科员以下岗位已有0人报名,更多关于2025广东选调生报名推荐表填写模板,河源市东源县新港镇人民政府一级主任科员以下
ai打开多页pdf文件怎么打开
随着数字文档的普及PDF文件成为了现代办公和学习中的要紧工具。尤其对那些包含大量图表、图像和文本的多页PDF文件而言,其便利性和可携带性使其成为不可或缺的格式。当涉及到采用人工智能()技术解决这些复杂的PDF文件时,客户或许会遇到
ChaetGPT免费访问——开启人工智能写作新时代
ChaetGPT免费访问——开启人工智能写作新时代想象一下,有一种工具可以帮助你解决写作难题,提供灵感,并快速生成高质量的内容。这个工具就是ChaetGPT!而现在,ChaetGPT推出了免费访问的活动,让更多的人体验到人工智能写作的魅力,开启了
3D1月周六走势图近50期
功能类福彩3D显示遗漏:显示/隐藏遗漏值,遗漏值是指自上期开出到本期间隔的期数。福彩3D遗漏分层:是将当前遗漏值用柱状图形标注。福彩3D分段线:是每五期使用分隔线,使横向导航更加清晰。福彩3D显示断区:在分区走势中使用,将开出0个号
AITDK
内容创作和编辑:通过标题生成器和描述生成器,帮助内容创作者快速生成吸引人的标题和简介,确保文章符合SEO要求并能吸引读者。产品或服务页面优化:使用功能生成器和关键词生成器,电商网站或服务平台能够快速创建详细的产品描述和SEO友好
COD使命召唤21加速器怎么用 延迟低不卡顿加速器推荐
COD使命召唤21加速器怎么用 延迟低不卡顿加速器推荐
GRE考试培训机构哪家好一点?全面评测与推荐
在选择GRE考试培训机构哪家好一点时,考生们常常面临众多选择。在这个过程中,了解不同机构的课程设置、教学效果以及费用等信息至关重要。本文将为您详细解析如何选择合适的GRE培训机构。首先,GRE备考的关键科目包括阅读、填空、数学和写
相关文章
推荐文章
发表评论
0评