分享好友 最新动态首页 最新动态分类 切换频道
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.

最新文章
Git笔记
目录 Git初识 1.为什么使用Git? 2.Git是什么?有什么用? 3.需要学习Git的什么? Git安装 1.下载 2.安装 3.检验安装 VSCode检验安装(老师推荐使用这个终端) Bash终端检验安装 控制台检验安装 4.Git
iPhone 17系列摄像头大改,安卓新机或将跟进新设计?
近期,有关iPhone 17系列手机的最新设计细节逐渐浮出水面,引发了广泛关注。据供应链内部消息透露,这款备受期待的智能手机将在摄像头设计上迎来显著变化。具体而言,iPhone 17系列将采用横条形三摄布局,这一新颖的设计目前仍处于保密阶段
360是怎样盈利的(整理)
1、如今主要是风险投资支持着,还有一个基本的收入来源是推销杀毒软件,比方当年卡巴斯基就是靠360给推广开来的,听说360每为卡巴斯基带来一个用户就能从卡巴斯基那里得到0.5元,眼下360上的广告非常少,从他们的软件上就能看出来.将来就不好说
2024年度所有游戏排行榜权威发布:经典手游推荐TOP10必玩榜单
1 永劫无间 杭州网易雷火科技有限公司 Android 动作、格斗 畅享高自由度的无拘战斗 2 三国杀OL 杭州游卡网络技术有限公司 Android、IOS 经典、策略 官方正版,卡牌竞技经典三国杀 3 大剑仙 广州红鹤网络科技有限公司 Android 仙侠、卡牌 Q
10个WordPress插件开发的提示
WordPress目前是互联网上使用最广泛的博客及信息发布平台之一。 从个人博客到企业解决方案,很多博客网站都由WordPress驱动,因此即使在经济危机的影响下,目前对WordPress插件开发人员的需求也大大超过往年。无论是WordPress插件开发新手
a16和a15性能对比:深入解析A16与A15处理器性能差异及应用场景
  随着科技的快速发展,手机处理器的性能提升成为用户选择设备的重要指标。尤其是在高端智能手机市场中,苹果公司的A系列芯片一直以来都备受关注。本篇文章将深入探讨A16和A15之间的性能差异,以及这两款芯片在实际应用中的表现。A16采用
2980元/1年,3600元/3年,4800元/5年
类 型自助版设计版推广版前期策划网站策划&对手分析 可单独购买 可单独购买 关键词工具 可单独购买 可单独购买 Web建站H5响应式 网站管理系统9.0 网站设计 自助 定制 定制 产品数量 500个 1000个 无限 设计包 (3横幅3内页50个产品添加)
ai写论文哪个软件最好?10个免费手机AI写论文软件
以下是一些比较受欢迎的 AI 写论文软件及其特点,你可以根据自身需求来选择:拥有高度模型的文章校对功能,免费版可查错别字、查语病、查成语搭配,对于论文的基础语言纠错很有帮助。普通会员限制为 2 万字 / 天,单篇文章 4000 字,并且支
Maya 2024 For Mac v2024.2玛雅3D设计软件中文版
对于M1/M2/M3/M4芯片的电脑,如果软件官方未兼容 M1/M2/M3/M4,可以使用 Rosetta2 转译运行。在Apple Silicon ARM Mac电脑上安装Rosetta 2 运行intel应用苹果自家的M1和M2/M3/M4芯片都是ARM架构,所以M1和M2/M3/M4是完全通用的,未来就算有
相关文章
推荐文章
发表评论
0评