-
Is it possible to merge a sitemap from an old domain to a new domain i.e Art-Faux.com to Art-Faux2.com? The old URLs http://art-faux.com and the new URLs https://art-faux2.com. I was thinking that I could use the “find and replace” in my Atom editor and upload the regenerated sitemap to art-faux2.com replacing the current one?
-
Hello,
Thanks for getting in touch with us.
We do not have that option and we do not recommend that anyway.
Google will only honor the URLs in your sitemap if they are present on your website only.
Google will ignore any external URLs in the sitemap even if the domains are almost the same.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
I’m not sure you understand This is the sitemap for the same website only with different domain name (art-faux.com) The new domain is (art-faux2.com) which is not getting indexed completely because of all the links are associated with the art-faux.com domain. I am not saying to just move the old sitemap into the same path. I am asking can the new site map be edited with Atom and/or Notepad ++ by “find and replace” to update the new sitemap and then upload it to replace the new sitemap?
Hello,
Rank math automatically generates the sitemap for the site domain according to the posts/pages you have published and set to index on your site. In your current site, head over to Rank math > Sitemap Settings to find the URL of your sitemap, which from my end appears fine, here is a screencast: https://i.rankmath.com/eOCujR
You should also ensure you have verified the correct URL and version(WWW or non-WWW) of your site in GSC and then submit your main sitemap(sitemap_inde.xml) for Google to crawl your site.
Hope that helps. If you have any further question(s), please let us know. Thank you.
Very Nice Thank You, I really dig this plugin. I am going to explain a little further about what my problem is. You see I started the blog in 2004 and I have a lot more out there than what the current sitemap is showing. Here is a link to a post I made at the time of the transition in 2009. My “old sitemap” is what’s holding the links to the rest of the history behind art-faux.com I believe. The change in domains was in 2018 (I think) and then this was when the current sitemap was resubmitted (if I remember right) I don’t have an answer as to why the whole history was not included in the new sitemap. I am wondering if I could add the corrected links to the sitemap manually. If I try to use any of the links in the old sitemap the link takes me to a dead page however if I correct the links it takes me to my current site.
SO my question is can I manually add the links to the sitemap or once I make those links live again will the sitemap automatically pick them up…
Here is the link when I posted about the transition and I think I was using AIO SEO but I would have to look in the old files to find out for sure.
https://art-faux2.com/faux-painting-ideas/brand-new-look/
I really appreciate your input.
Hello,
Thank you for the follow up.
Were the posts previously published moved to your new domain? If they were, you should just ensure they are set to index and Rank math will automatically add them to the posts sitemap.
If you still want to add them manually, you can do that with the help of the filter below:
/** Filter to add extra URLs to the XML sitemap by type. * Only runs for the first page, not on all. * @param string $content String content to add, defaults to empty. */ add_action( 'rank_math/sitemap/{$type}_content', function() { return '<url> <loc>https://rankmath.com/some-custom-url/</loc> <lastmod>2020-06-10T20:20:20+00:00</lastmod> </url>'; });
Replace
{$type}
with eitherpost
orpage
depending on if you want the URL to be include in the post or page sitemap – respectively.Hope that helps. If you have any further question(s), please let us know. Thank you.
Thank you so much, Yes that’s what I didn’t understand as to why they weren’t changed with the previous sitemap. I mean they’re there but not with the corrected URL links have not completely. When I run into one of the images I have to correct the URL by adding the “2” but the http has been converted to the https. I even have inner links that are not right until I correct them, but yet are not detected as broken.
As far as the code do I add that (just to be sure) to the function_php file? and where?
Thank you
Hello,
Yes, that code needs to be added to the functions.php file of your theme.
Thank you, I am not a developer so please excuse my ignorance but do I still add the URLs manually to the sitemap after adding the code to the function.php file or will the URLs just be picked up naturally as they are without having to correct them and correct the URLs itself?
Also will I have to re-enter the code after a theme update?
Hello Arthur,
Thank you for the follow up.
Please read through the following carefully:
The code I provided is the manual way of adding the URLs. You will have to replace
https://rankmath.com/some-custom-url/
with your URLs and duplicate the code block for all the URLs you wish to add to the sitemap. To avoid the code being overwritten you should create a child theme and add your code there. If you are not a developer, you might have to hire one to do this.Changing the URLs is a separate option, in which case you would not need the above function. You can correct the URLs of the posts and set the posts to index in Rank math meta box under the Advanced tab and they will be added to the sitemap automatically.
Looking forward to helping you. Thank you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.
The ticket ‘merging sitemaps’ is closed to new replies.