As you get more acquainted with Shopify, you might stumble upon some of its limitations. One that often catches merchants off guard is the inability to upload files directly to the root domain or any subfolders of your Shopify store. This can be a hurdle when you're trying to submit a custom XML sitemap to search engines.
But don't fret - with a bit of technical finesse, there’s a workaround. In this guide, I’ll show you how to upload custom XML sitemap files to your Shopify store and submit them to Google Search Console, improving URL discovery and ensuring search engines can find your pages more efficiently.
In the Shopify administration area head over to Content > Files and proceed to upload the XML file via the file manager. Take note or copy the Shopify CDN file path for your newly uploaded XML file.
Google Search Console (GSC) typically rejects sitemap URLs that aren't served from your store's root domain or its subfolders. So, submitting the CDN URL directly won't work.
Create Your Custom XML Sitemap
Upload the Sitemap to Shopify's File Manager
Create a URL Redirect in Shopify
Note: By removing the version parameter, you ensure that the redirect remains accurate even if you update the file later, the CDN URL without the version query stays the same.
Verify the Redirect
Submit the Sitemap to Google Search Console
Check the Submission Status
Whenever you need to update your sitemap:
If you get stuck or need a helping hand, don't hesitate to leave a comment below. I'm here to help you navigate these technical challenges and make the most out of your Shopify store.
Note* article updated January 2025
But don't fret - with a bit of technical finesse, there’s a workaround. In this guide, I’ll show you how to upload custom XML sitemap files to your Shopify store and submit them to Google Search Console, improving URL discovery and ensuring search engines can find your pages more efficiently.
Why Would You Need a Custom XML Sitemap on Shopify?
Before we dive into the steps, it's important to understand why you might need a custom XML sitemap:- International SEO: If your store targets multiple countries or languages, a custom sitemap can include hreflang tags to inform search engines about language and regional targeting.
- Additional Content: You might have pages or content not automatically included in Shopify's default sitemap (like blog posts from an external platform) that you'd like search engines to index.
- Prioritising Pages: Custom sitemaps allow you to set priorities and change frequencies for different pages, offering more control over how search engines crawl your site.
- Tagged Collection Pages: Shopify's default sitemap doesn't include tagged collection pages.
- Image Sitemaps: If your store relies heavily on high-quality images, an image sitemap can help search engines index them more effectively.
- Video Sitemaps: If your Shopify site features video content, a video sitemap ensures that search engines can properly index and display video results in search.
How to Upload Custom XML Sitemap Files
Let us assume that you have already created the XML sitemap that you like to submit to Google Search Console (GSC). Head over to the Shopify file manager within your online shop.In the Shopify administration area head over to Content > Files and proceed to upload the XML file via the file manager. Take note or copy the Shopify CDN file path for your newly uploaded XML file.
The Challenge with Shopify's File Structure
Due to Shopify's platform architecture, any files you upload, whether PDFs, images, or XML files, are served from Shopify's Content Delivery Network (CDN). This means that when you upload a file, it gets a URL like:
Code:
https://cdn.shopify.com/s/files/1/0456/4071/2355/files/custom-sitemap.xml?v=1597220084
Google Search Console (GSC) typically rejects sitemap URLs that aren't served from your store's root domain or its subfolders. So, submitting the CDN URL directly won't work.
The Workaround: Redirecting to Your Custom Sitemap
To get around this, we'll create a URL redirect from your store's root domain to the CDN URL of your sitemap. This satisfies GSC's requirement and ensures your sitemap is accepted.Step-by-Step Guide to Uploading a Custom XML Sitemap in Shopify
Create Your Custom XML Sitemap
- Use a sitemap generator or create it manually.
- Ensure it's properly formatted according to XML sitemap standards.
- Save it with a clear name, like custom-sitemap.xml.
Upload the Sitemap to Shopify's File Manager
- Log in to your Shopify admin panel.
- Navigate to Content > Files.
- Click on Upload files and select your custom-sitemap.xml.
- Once uploaded, copy the file URL provided. It will look something like the CDN URL mentioned earlier.
Create a URL Redirect in Shopify
- Go to Online Store > Navigation
- Select URL Redirects
- Click on Create URL redirect
- In the Redirect from field, enter /custom-sitemap.xml (this is the URL path on your root domain)
- In the Redirect to field, paste the CDN URL of your uploaded sitemap, but remove the version query parameter (the ?v=1597220084 part). So it should look like:
Code:
https://cdn.shopify.com/s/files/1/0456/4071/2355/files/custom-sitemap.xml
Verify the Redirect
- Open a new browser tab
- Go to https://yourstore.com/custom-sitemap.xml
- Ensure it redirects properly and displays your sitemap content
Submit the Sitemap to Google Search Console
- Log in to your GSC account
- Select your website property
- Navigate to the Sitemaps section
- In the Add a new sitemap field, enter custom-sitemap.xml
- Click Submit
- GSC will now use the redirect to access your sitemap on the CDN
Check the Submission Status
- Check for any errors or issues reported by GSC
- If the status says couldn't fetch, refresh the page
If everything is set up correctly, GSC should accept your sitemap without any problems.
Whenever you need to update your sitemap:
- Simply upload the new custom-sitemap.xml file to Content > Files, overwriting the existing one.
- Because the CDN URL (without the version parameter) remains the same, and your redirect is already set up, there's no need to change anything else.
- GSC will automatically find the updated sitemap the next time it crawls your sitemap URL.
Additional Tips and Considerations
- Removing the Default Shopify Sitemap: If your custom sitemap is intended to completely replace Shopify's default sitemap, you might consider removing the default sitemap from GSC to prevent confusion.
- Bing Webmaster Tools: This method should also work with Bing Webmaster Tools and other search engines that follow redirects to sitemaps.
- Monitoring Performance: Regularly check GSC for any crawl errors or issues related to your sitemap to ensure your pages are being indexed properly.
- Consistency is Key: Make sure the URLs in your custom sitemap are accurate and reflect the current structure of your site.
- Consider adding to Robots.txt: If you're comfortable editing robots.txt, add a declaration of the new sitemap file.
Why Does This Method Work?
By creating a redirect from a URL on your root domain to the CDN-hosted sitemap, you're effectively tricking (for lack of a better word) GSC into accepting the sitemap. Since the redirect originates from your domain, GSC considers it valid.Wrapping Up
Submitting a custom XML sitemap to Shopify might seem daunting due to the platform's file restrictions. But with this simple workaround, you can have your custom sitemap up and running in no time, giving you greater control over how search engines crawl and index your site.If you get stuck or need a helping hand, don't hesitate to leave a comment below. I'm here to help you navigate these technical challenges and make the most out of your Shopify store.
Note* article updated January 2025
Attachments
Last edited: