What the two files do
A sitemap is a list of your pages. It helps Google find them, though it doesn't guarantee they will be listed. Google counts a site of about 500 pages or fewer as small, and a small site whose pages all link to each other may not need one. A new site with few links to it is more likely to.
robots.txt tells crawlers which addresses they may open. It isn't a way to hide a page: Google can still list a blocked address if other sites link to it.
Find yours
- Open
yourbusiness.com/sitemap.xml. You should see a list of addresses, or a list of more sitemaps. - If it isn't there, open
yourbusiness.com/robots.txtand look for a line that starts withSitemap:. - Check that the list has your real pages, with the same
https://address customers use, and none you deleted.
Submit it
- Sign in to Google Search Console and choose your site. You need owner access.
- Open Sitemaps, paste the full address under Add a new sitemap and click Submit.
- Come back later and read the status. Success means Google read it. Couldn't fetch means Google couldn't get the file, for example because it's blocked, missing or the server had a problem.
If you edit a sitemap by hand, keep the last changed dates true. Google uses them only when they are accurate, and it ignores the priority value.
Fix a missing sitemap or robots.txt
sitemap.xml
About 15 minutes
- Make sure
yoursite.com/sitemap.xmlloads and lists your pages. Most builders and SEO plugins make one for you. - Add a
Sitemap: https://www.example.com/sitemap.xmlline to robots.txt. - Submit the sitemap in Google Search Console under Sitemaps.
- WordPress makes a sitemap at
/wp-sitemap.xml. Yoast SEO and Rank Math replace it with/sitemap_index.xml. - Submit whichever one loads in Google Search Console under Sitemaps.
- Squarespace makes
/sitemap.xmlfor you and keeps it up to date. - Connect Search Console from Analytics › Search keywords › Connect, then submit
sitemap.xmlin Search Console under Sitemaps.
- Wix makes the sitemap for you. Connect Google from the SEO Setup Checklist and Wix submits it.
- Or submit
sitemap.xmlyourself in Google Search Console under Sitemaps.
- Shopify makes
/sitemap.xmlfor you. The store must be public (not password-protected). - Submit
sitemap.xmlin Google Search Console under Indexing › Sitemaps.
- Go to Site settings › SEO › Sitemap, turn on the automatic sitemap, save and publish. Webflow adds it to robots.txt.
- Submit
sitemap.xmlin Google Search Console under Sitemaps.
robots.txt present and lets Google load CSS and JS
About 10 minutes
- Make sure
yoursite.com/robots.txtloads and doesn't block CSS or JavaScript files (noDisallowlines for theme, script or style folders). - A simple file is enough:
User-agent: *,Disallow:and a line pointing at your sitemap, such asSitemap: https://www.example.com/sitemap.xml. - If it returns a server error, ask your host to fix it, because Google may pause crawling until it loads.
- WordPress makes a basic robots.txt for you. To edit it, use Rank Math (General Settings › Edit robots.txt, in Advanced Mode) or Yoast SEO's file editor.
- If a real
robots.txtfile sits in your site's main folder, it replaces the plugin's version; ask your host to edit or remove it.
- Squarespace writes robots.txt for you and you can't edit it. If it blocks the site, turn off Settings › Crawlers › Block Search engine crawlers.
- Go to SEO & GEO › Tools and settings › Robots.txt Editor and click View File.
- Remove lines that block style or script files, or use Reset to Default.
- Shopify writes robots.txt for you and the default is fine for most stores.
- If it's been changed, a developer can edit the
robots.txt.liquidtemplate under Online Store › Themes › Edit code. Deleting that template brings back the default.
- Go to Site settings › SEO › Indexing, edit the robots.txt rules, save and publish.
When to ask for help
Ask if the sitemap shows an error instead of a list, if it's full of addresses you don't know, or if robots.txt has lines nobody remembers adding. A wrong line there can keep a whole site out of search.
Ethan Stoner, who makes WebCheckup, also fixes small-business sites. Ask for a quote.
What WebCheckup checks
The checkup runs these checks on this subject. Each link goes to its place in our full list.
Sources
- Google Search Central: Learn about sitemaps
- Google Search Central: Build and submit a sitemap
- Search Console Help: Sitemaps report
- Google Search Central: Introduction to robots.txt
The builder steps are the ones in our reports, written from each builder's own help pages. Menus change, so a label may have moved.