Andy
Andy

Reputation: 1163

How to create sitemap for website with different pages in mobile and desktop?

I have a website that has two different pages structure - one for mobile visitors, and one for desktop. That's why I have two sitemap files - one for the mobile and one for desktop.
I want to create a robots.txt file that will "tell" search engines bots to scan the mobile sitemap for mobile sites, and the desktop sitemap for desktop sites.
How can I do that?

I thought of creating a sitemap index file which will point to both of those site maps, and to add the following directive to the robots.txt file:

sitemap: [sitemap-index-location]

It this the right way?

Upvotes: 1

Views: 1899

Answers (4)

Fred Wuerges
Fred Wuerges

Reputation: 1965

I can not give you a certainty, but I believe the best practice is to inform the two sitemaps in robots.txt. In mobile sitemap you already have the markings <mobile:mobile/> is reporting that a mobile version.
Another interesting question is perhaps also create a sitemap index:

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>http://example.com/sitemap.desktop.xml</loc>
    </sitemap>
    <sitemap>
        <loc>http://m.example.com/sitemap.mobile.xml</loc>
    </sitemap>
</sitemapindex>

And your robots.txt will look like:

# Sitemap index
Sitemap: http://example.com/sitemap.xml
# Other sitemaps. I know it is already declared in the sitemap index, but I believe it will do no harm also set here
Sitemap: http://example.com/sitemap.desktop.xml
Sitemap: http://example.com/sitemap.mobile.xml

Upvotes: 3

Stephen Ostermiller
Stephen Ostermiller

Reputation: 25524

In addition to stating the files in robots.txt, you should log into Google Webmaster Tools and submit the sitemaps there. That will tell you

  • If the sitemap url you submitted is correct
  • That the sitemap file has the correct syntax
  • How many of the files in the sitemap have been crawled
  • How many of the files in the sitemap have been indexed

Upvotes: 0

Jessica Eldridge
Jessica Eldridge

Reputation: 810

I think I will recommend you for the responsive website design.

With the help of a responsive web design technique, you can build the alter web pages using CSS3 media queries. Here, there is one HTML code for the page regardless of the device accessing it. But, its presentation changes through CSS media queries to specify as to which CSS rules apply to the browser for displaying the page.

With responsive website design, you can keep both the desktop and mobile content on a single URL. It is easier for your users to interact with, share, and link to and for Google’s algorithms to assign the indexing properties to your web content.

Besides, Google will crawl your content effectively and there won’t be any need to crawl a web page using a different Googlebot user agent.

You can simply define a single sitemap and put in robots.txt file. It will crawl both for your desktop and mobile content.

Upvotes: 0

microease
microease

Reputation: 9

robots.txt does not tell the search engine which mobile end which is the end of your PC, and he can only declare a sitemap.This is sufficient Well, I think you can add a judge in the html page header, the pc end pc side web mobile end mobile page, this is not good?Site Map there is on the page there is a link to, then more to promote inclusion.

Upvotes: 0

Related Questions