{"id":1143,"date":"2015-10-28T04:06:42","date_gmt":"2015-10-27T22:06:42","guid":{"rendered":"http:\/\/promincproductions.com\/blog\/?p=1143"},"modified":"2021-10-23T13:56:25","modified_gmt":"2021-10-23T18:56:25","slug":"magento-xml-sitemap-setup-fixing-errors","status":"publish","type":"post","link":"https:\/\/promincproductions.com\/blog\/magento-xml-sitemap-setup-fixing-errors\/","title":{"rendered":"Magento 1: XML Sitemap Setup &#8211; Fixing Errors"},"content":{"rendered":"<p>I had an issue in Magento getting an XML sitemap to generate. &nbsp;This site was launched a site about 6 months ago, and now went through a rather massive redesign and is being relaunched. &nbsp;URL changes, etc. are all at play here. &nbsp;This is under a Magento install that has multiple stores in it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Confusion About Configuration<\/h2>\n\n\n\n<p>An XML sitemap was created upon initial launch, however hasn&#8217;t been updated since. &nbsp;I&#8217;m not sure&nbsp;of a few things though &#8211; both how the sitemap got generated to begin with and how it never regenerated after that. &nbsp;The reason for my confusion is that the sitemap was never defined in the Magento Admin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Error Message from Magento<\/h2>\n\n\n\n<p>But to make things &#8220;worse&#8221;, when I went to setup this sitemap in the Magento Admin (<strong>Catalog -&gt; Google Sitemap -&gt; Add Sitemap)<\/strong>, I received the following&nbsp;error message:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Path \"\/sitemap_*****.xml\" is not available and cannot be used.<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2015\/10\/Magento-Error-Sitemap-Setup.jpg\" rel=\"attachment wp-att-44\" data-lasso-id=\"527\" data-rel=\"lightbox-gallery-gijWhhiD\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" width=\"500\" height=\"246\" src=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2015\/10\/Magento-Error-Sitemap-Setup-500x246.jpg\" alt=\"Error message from Magento when Setting up Sitemap\" class=\"wp-image-1144\" srcset=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2015\/10\/Magento-Error-Sitemap-Setup-500x246.jpg 500w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2015\/10\/Magento-Error-Sitemap-Setup-150x74.jpg 150w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2015\/10\/Magento-Error-Sitemap-Setup-600x295.jpg 600w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2015\/10\/Magento-Error-Sitemap-Setup.jpg 635w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption>I received this error message when trying to setup an XML sitemap in Magento.<\/figcaption><\/figure><\/div>\n\n\n\n<p>Now in fairness, this path\/file already existed. &nbsp;So I tried a different file name but got the same error message. &nbsp;My guess of what is happening here is there is a file permissions issue happening? &nbsp;I&#8217;m not 100% sure though.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fixing the Problem<\/h2>\n\n\n\n<p>Where there&#8217;s a will there&#8217;s a way, right? &nbsp;As with many operations that seem to fail in Magento, it&#8217;s time to just go right to the database. &nbsp;The data for this feature of Magento is found in the <b>sitemap&nbsp;<\/b>table. &nbsp;Simply fill in the following fields &#8211; all others can be left null:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>sitemap_filename\n<ul>\n<li>Filename of the sitemap file you wish to create<\/li>\n<\/ul>\n<\/li><li>sitemap_path\n<ul>\n<li>The path that you want the sitemap file to be saved to. &nbsp;Use &#8220;\/&#8221; for the root directory.<\/li>\n<\/ul>\n<\/li><li>store_id\n<ul>\n<li>The numeric store ID for the store you wish to have the sitemap generated for.<\/li>\n<\/ul>\n<\/li><\/ul>\n\n\n\n<p>Save this data to the database, then go back to the Magento Admin to&nbsp;<strong>Catalog -&gt; Google Sitemap<\/strong>. &nbsp;You should see your new sitemap display on the list. &nbsp;Click the&nbsp;<strong>Generate<\/strong> link and Magento should do the rest of the hard work from here. &nbsp;Likewise the CRON job that refreshes the sitemaps from here on forward should now work.<\/p>\n\n\n\n<p>One potential other issue that you might run into on this final step is that I&#8217;m not 100% sure if Magento will create the file successfully at this time or not. &nbsp;In my case the file was already there and I didn&#8217;t take the time to test if it would generate a file if it didn&#8217;t exist.<\/p>\n\n\n\n<p>Also of note &#8211; my file permissions for this XML sitemap file&nbsp;are set to 666 (RW- RW- RW-).<\/p>","protected":false},"excerpt":{"rendered":"<p>I had an issue in Magento getting an XML sitemap to generate. &nbsp;This site was launched a site [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1144,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[46,5],"tags":[],"class_list":["post-1143","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento","category-website-development"],"jetpack_featured_media_url":"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2015\/10\/Magento-Error-Sitemap-Setup.jpg","jetpack_shortlink":"https:\/\/wp.me\/p4BbcR-ir","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts\/1143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/comments?post=1143"}],"version-history":[{"count":2,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts\/1143\/revisions"}],"predecessor-version":[{"id":2038,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts\/1143\/revisions\/2038"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/media\/1144"}],"wp:attachment":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/media?parent=1143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/categories?post=1143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/tags?post=1143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}