How do I edit sitemap.xml without using FTP?

How do I edit sitemap.xml without using FTP?

eduard95
Excursionist
16 0 2

Hello, does anyone know how to edit sitemap.xml? I've read a post that we can edit it through FTP (https://www.websitebuilderinsider.com/how-do-i-update-my-sitemap-on-shopify/#:~:text=Updating%20your.... However, I can see posts that we can't access shopify server with FTP. I'm quite confused on which to believe. Thank you

Replies 12 (12)

pawankumar
Shopify Partner
706 102 123

I think, we can't edit sitemap.xml file, it will be default provided by shopify. You can access it via your-domain.myshopify.com/sitemap.xml or your-base-url/sitemap.xml

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan
Mont
Explorer
62 1 28

Just learned the sitemap generated in my store includes spam urls that were added by malicious bot. So thinking I will create my own tidy clean sitemap. But how to create in xml format. Then can I replace mystore.com/sitemap.xml. File?

Doronsniper
Visitor
1 0 0

Same here, any clue what to do with this?

Mont
Explorer
62 1 28

Don’t know. All i do know is that my Google ranking has dropped considerably . Screenshots from our Google console. At least Google stopped indexing  bad content. But still affects ranking. 

AD31697F-FDF8-44CE-AC30-2445108E5F47.jpeg

6FE8643C-509A-41D3-87B4-B3A3A87CB8B9.jpeg

danafleur
Shopify Partner
4 0 1

** We came up with a workaround! ** Search engines look for a sitemap.xml in your root folder, as does Google. But with Google, you can enter a sitemap at any URL on your domain.

1. Upload your desired sitemap (or sitemaps) to Files
2. Copy the URL of that file upload
3. Create a URL Redirect with whatever path you want (/sitemap/ ?) and point that to the URL of the uploaded file
4. Submit the redirect to Google as your sitemap

 

This worked perfectly for us, with bumped rankings for the level of specificity we got with our tailored sitemap.

@JMont 
You still cannot replace the existing sitemap but you can make a strong sitemap that may reduce the impact of any bad URLs added. Or take advantage of those URLs to redirect to good pages on your site, though not sure the impact if you can't change the canonical URL for the bad URLs inserted.

dev-kriya
Shopify Partner
3 0 0

Hi @danafleur 

Thanks for your suggestion.

 

We did upload the sitemap to Files, and got a Shopify CDN link.

 

How do I create a redirect from Shopify Domain to a page of my website, which google would crawl ultimately?

As the file uploaded is hosted on Shopify domain; i am not able to create a URL Diredirect.

mattsoapeq
Visitor
1 0 0

I utilized this same solution, and ended up using a reverse proxy (Cloudflare) to setup the redirect.

 

Be aware that if you go the Cloudflare route, you'll need to request origin-to-origin from their team, or otherwise this won't work.

dev-kriya
Shopify Partner
3 0 0

Thanks for the suggestion. Will explore the solution.

danafleur
Shopify Partner
4 0 1

@dev-kriya If you're using Shopify for your storefront, go to Online Store --> Navigation --> View URL redirects (link at top right). From there you can create a redirect. 

Screen Shot 2024-04-10 at 11.48.09 AM.png

dev-kriya
Shopify Partner
3 0 0

Thanks, however the "files uploaded" in Shopify are hosted in shopify CDN domain - cdn.shopify.com & have a link of the form - https://cdn.shopify.com/s/files/1/0650/9730/2237/files/{{file_name}}

 

Shopify does not allows to create URL redirect for this. This only works if both the links are under my domain, right? @danafleur 

danafleur
Shopify Partner
4 0 1
It shouldn't be a problem that it's a different domain. We did the
following:

1. Upload the file to get the URL like yours:
https://cdn.shopify.com/s/files/1/0650/9730/2237/files/{{file_name}}
2. Create a page on main domain, say www.mydomain.com/pages/mydomain-sitemap
and set it to HIDDEN
3. Create a new redirect where the Redirect From is the Shopify page
and the Redirect To is the file on the Shopify CDN

Note that a redirect will only work if the Redirect From page does not
exist, which is why you must set the page to hidden

[image: Screen Shot 2024-04-11 at 10.43.39 AM.png]
odessy1
Shopify Partner
3 1 1

Another workaround is to use the SEO hidden metafield to hide pages (page, product, collection) from search. It also removes it from the sitemap.