How to create a Baidu and Google compatible sitemap for WordPress (Sitemap)

WordPress is a great open source platform for Baidu and Google SEO optimization, and creating a sitemap is one of the most important tools for improving the SEO of your WordPress website. A sitemap helps visitors and search engines better understand your website structure.

Understanding sitemaps is very helpful in further developing your WordPress website. Not only does it enhance the user experience, but it also ensures that search engines can crawl your site's content accurately.

In this article, we'll explain in detail why WordPress sites need sitemaps and differentiate between XML sitemaps and HTML sitemaps and their respective optimization roles.

In addition, we will guide you on how to create sitemaps for your WordPress website and submit these sitemaps to Google and Baidu.

Now, let's start learning how to create and submit sitemaps.

Image[1]-How to create a Baidu and Google compatible sitemap for WordPress (Sitemap)-Photonflux.com | Professional WordPress Repair Service, Global Reach, Fast Response

What is a WordPress sitemap and why do I need it?

A WordPress sitemap is a list of links to all public pages on a website. This map helps visitors and search engines find all the content on the site easier and faster. It also shows the links between pages and how important each page is. To learn more about sitemaps, check out our detailed guide.

WordPress sitemaps have many benefits for website owners:

Update Alert: The sitemap automatically informs search engines whenever there is new content on the site and is displayed to visitors. It also informs search engines of new pages on the site that have not been found before. Easy to navigate: Provides a complete list of links to web pages, showing the structure and hierarchy of the site, making it easier to navigate. Search Engine Optimization: Helps optimize a website by making sure search engines know there is no duplicate content on the site. A good sitemap also enhances the user experience of your website and helps to improve your website's ranking on search engine results pages (SERPs).

Differences between XML and HTML WordPress sitemaps

WordPress websites have two types of sitemaps: XML sitemaps and HTML sitemaps, both of which play an important role in website optimization.

When you submit your WordPress sitemap to search engines, you should use an XML format sitemap. This format helps search engine crawlers find and read the content and information on the site more easily.XML sitemaps also provide more information about each web page, such as when it was updated and how important the page is.

On the other hand, an HTML sitemap lists the links to all the pages on the website using HTML formatting. This type of sitemap is more suitable for website visitors as it shows the structure of the website in an easy to understand manner.

The main difference between these two types of sitemaps is that XML sitemaps are designed primarily for search engines and are usually placed on a separate web page address; whereas HTML sitemaps are designed for website visitors and are usually embedded directly into the website for viewing.

To ensure the best user experience and to improve your website's ranking in search engines, we recommend using both types of WordPress sitemaps.

How to generate WordPress XML sitemap manually?

Making a WordPress XML sitemap can help tell search engine robots what information is on your site. However, it can take a lot of time if you have to make this map yourself, especially if your site has more than 10 pages.

If you want to make your own WordPress sitemap, you'll need to use a text editor, like Notepad for Windows or Nano for Linux and macOS. remember that the file you make needs to be in XML format. This file should list all the links to the pages on your site and contain all the important information for search engines.

Below is an example of an XML sitemap:

<urlset
       http://www.example.com/  _ _
       2021-07-18  _
       monthly _ _ _ _ _
       0.5  _
    _ _
 _ _

There are some tags in the sitemap that are required and others that are optional. Here are the mandatory tags and what they are used for:

  • : This tag is used to follow current sitemap standards. Keep it in your sample XML sitemap file.
  • : This is the parent tag that is used to contain all the other tags.
  • : This represents the address of the specific page of your site. The address needs to start with http and end with a slash if your server uses it. The content in this tag cannot exceed 2,048 characters.

There are also some optional tags that you might consider adding:

  • : Displays the date the site was last modified, using the year-month-day format.
  • : Shows how often the site is updated. This can be "always", "hourly", "daily", "weekly", "monthly", "yearly" or "never".
  • : Tells search engines which pages are most important. Valid values are between 0.0 and 1.0, if you don't set it, the default is 0.5.

After you have created your XML sitemap, you need to upload it to the root directory of your WordPress site. Next, you can view it by visiting your sitemap link, which is usually formatted like this:

http://example.com/sitemap.xml

After finding your sitemap link, you need to verify that it is correct using a sitemap checker tool. If the sitemap is incorrect, it may affect the performance of your WordPress site in the search engines. So, before you submit your sitemap to search engines like Google, make sure to verify it with a checking tool.

To verify, simply enter your sitemap address into the sitemap checker tool and click "Validate Site Map"Button.

Image[2]-How to create a Baidu and Google compatible sitemap for WordPress (Sitemap)-Photonflux.com | Professional WordPress Repair Service, Global Reach, Fast Response

If the WordPress sitemap is valid, it will display the"No problems detected."Banner.

Image[3]-How to create a Baidu and Google compatible sitemap for WordPress (Sitemap)-Photonflux.com | Professional WordPress Repair Service, Global Reach, Fast Response

However, if the WordPress sitemap is invalid, it will display the"Problem detected."Warning message.

Image[4]-How to create a Baidu and Google compatible sitemap for WordPress (Sitemap)-Photonflux.com | Professional WordPress Repair Service, Global Reach, Fast Response

How to generate WordPress XML sitemap using plugin?

The easiest way to automatically generate a sitemap in WordPress is to install a sitemap plugin. This method is not only fast and reliable, but it also adds additional optimization features to your site.

By installing specific WordPress plugins, you can easily update your website and automatically reflect any changes on your sitemap.

Below, we'll walk you through how to create an automated XML sitemap using two of the best WordPress plugins.

Using Yoast SEOGenerate WordPress sitemap

To automatically generate sitemaps in WordPress, you can install a plugin called sitemaps. Such plugins provide quick and easy way to generate sitemaps for your WordPress website.

After installing these WordPress plugins, they not only automatically generate sitemaps for your site, but they also automatically update the sitemap when there are updates to your site's content.

Here are the steps to automatically generate an XML sitemap using two popular WordPress plugins - Yoast SEO and Google XML Sitemaps.

Steps to generate a WordPress sitemap using Yoast SEO:

  1. In the WordPress dashboard, go to Plugins > Add New.
  2. Search for "Yoast SEO" plugin.
  3. Once you have found the plugin, click "Install" and then "Activate" to enable the plugin.
Image[5]-How to create a Baidu and Google compatible sitemap for WordPress (Sitemap)-Photonflux.com | Professional WordPress Repair Service, Global Reach, Fast Response

In the WordPress dashboard, find and click on the "Yoast SEO" menu and select "Settings". Scroll down the page until you find the "API Interfaces" section and click on the View your XML sitemap link.

Image[6]-How to create a Baidu and Google compatible sitemap for WordPress (Sitemap)-Photonflux.com | Professional WordPress Repair Service, Global Reach, Fast Response

How to generate WordPress XML sitemap using pure code?

There are two ways you can create a site map (sitemap) in a WordPress website. The first is to use a plugin, WordPress has many plugins to choose from, you can search and install the right plugin according to your personal preference. The second way is not to use plugins, directly through the code to create a sitemap.

The sitemap.xml file can be generated automatically using the WordPress timed tasks feature. This approach is better than generating the xml file directly when the post is saved or published because it does not cause the page to lag when editing the post.

To use this method, create a file called gsitemap.php in the root directory of your website and add specific code to it.

?php
require('... /wp-blog-header.php');
header("Content-type: text/xml");
header('HTTP/1.1 200 OK'); echo '<?
echo ''; echo '<?xml version="1.0" encoding="UTF-8"?
echo ' '
? >'; echo ' ' ?
<! -- generated-on=-->
  

</lastmod
daily
1.0
</url
 10,000,
  'post_type' => 'post'
);
$myposts = get_posts( $args );
foreach( $myposts as $post ) { ? >
  
      
      
      monthly
      0.6
  </url

 1000,
  'post_type' => 'product'
);
$myps = get_posts( $args );
foreach( $myps as $post ) { ? >
  
      
      
monthly
      0.6
  </url

 $pro ) {
    $link = get_term_link( intval($pro->term_id), "products" );
         if ( is_wp_error( $link ) )
          return false.
          $pros[ $key ]->link = $link; ?
? >
  
      
      
      weekly
      0.6
  </url

 0) {
    foreach($mypages as $page) { ? >
    
      ID); ? >
      ID)->post_modified); ? >+00:00
      weekly
      0.6
  </url

 0){
foreach ($terms as $term) { ? >
    
      slug); ? >

      weekly
      0.8
  </url

 $tag ) {
    $link = get_term_link( intval($tag->term_id), "post_tag" );
         if ( is_wp_error( $link ) )
          return false;
          $tags[ $key ]->link = $link; ?
? >
 
      

      monthly
      0.4
  </url

</urlset

Create a new auto-executing program that automatically generates XML maps every day

Image[7]-How to create a Baidu and Google compatible sitemap for WordPress (Sitemap) - Photon Flux | Professional WordPress repair service, worldwide, fast response
Image[8]-How to create a Baidu and Google compatible sitemap for WordPress (Sitemap)-Photonflux.com | Professional WordPress Repair Service, Global Reach, Fast Response

How to submit WordPress XML sitemap to search engines?

Submitting WordPress sitemaps to search engines like Google and Bing is a good idea, even though search engines can sometimes find your site automatically. There are several benefits to submitting your WordPress XML sitemap manually:

SEO - Submitting a sitemap ensures that search engines are immediately informed when new content or changes are made to your site. This can help keep your pages up to date in search results.

accuracy - Submitting a sitemap ensures that search engines index only the most accurate and relevant content on your site.

free (of charge) - Generating and submitting WordPress sitemaps is completely free.

More visitors - Helps your site rank higher in search results, which attracts more natural traffic.

Attention! Before submitting your WordPress site to search engines, make sure you have an XML sitemap URL, which usually looks like this:https://www.seo628.com/gsitemap.xml

Submit XML sitemap to Google

Submitting a WordPress sitemap to Google can help your website attract more visitors and increase its visibility. For this purpose, you can use Google Search Console tool.

First, log into your Google account and follow the steps below to submit your sitemap:

Image [9]-How to create a Baidu and Google compatible sitemap for WordPress (Sitemap)-Photonflux.com | Professional WordPress Repair Service, Global Reach, Fast Response

reach a verdict

This article describes three ways to generate a WordPress sitemap: creating it manually, using a plugin, and generating it directly without a plugin. If you choose to create it manually, you can customize what the sitemap contains, but this can be more time-consuming and requires an additional step to verify that the sitemap is valid.

In contrast, we recommend using the Yoast SEO plugin or code to quickly create an XML sitemap. The article also details how to submit a WordPress sitemap to Google.

Frequently Asked Questions

Does WordPress automatically update the sitemap??

Whether you're using the features that come with WordPress or have a plugin installed to generate a sitemap, it will automatically update every time you publish a new post or page.

Do I have to have a sitemap to do SEO on my WordPress site?

While having a sitemap is not required, it is a recommended good habit. Because creating a sitemap only takes a few minutes and it will only benefit your website, we highly recommend that you create one.

How do I know my sitemap is working properly?

To view your sitemap, you can find it in the Google Search Console and click on the "sitemap" section.


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
Customer Service
Customer Service
Tel: 020-2206-9892
QQ咨詢:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
? Reprint statement
This article was written by Harry
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments