• iwishyouthebestofthebest

    (@iwishyouthebestofthebest)


    Dear WordPress community,
    this is the first time I write, in fact I am very excited, and I even notice that my fingers are shaking … hey no! one moment! but here everything is shaking … OHHHH NOOOOO, it’s an earthquake !!!!!!!!
    OK, now that I’m safe again I can continue writing my message …
    First of all, congratulations on all your work. If WordPress is the # 1 CMS in the world today, it is thanks to you.
    Secondly, I contact you to ask for information.
    I have installed WordPress multisite.
    I did it to create the first site in English, and the second the same as the first but in another language.
    Currently the structure of my sites is as follows:
    https://www.mysite.com
    https://www.mysite.com/subsite1/.

    Now, both of these sites, from the most recent versions of WordPress, have a sitemap set by default. In fact, if I go to https://www.mysite.com/wp-sitemap.xml or to https://www.mysite.com/subsite1/wp-sitemap.xml the sitemaps exist.
    The problem is that these sitemaps don’t link to each other, as they should. Therefore, I would like to disable the default ones and create 2 custom sitemaps.

    The problem is that, if on the one hand I know where to insert the sitemap for the first site (ie in the root folder of WordPress [in fact, if I do, the sitemap wp-sitemap.xml is overwritten]), I don’t know where to insert the sitemap for the second site. And I would like to know, in order to insert the sitemap of the first site in the root folder of WordPress, and that of the second site in the folder (if there is one) dedicated to the second site. But I would like to do all this without the use of plugins.

    Could anyone please help me?

    Thank you for your attention

    Thank you in advance for any response you want to give me, but in case you fail to do so, I still wish you the best of the best.

    A dear occasional to all

    Thank you all

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    Earthquake!? That 5.9 one down in Oz? Pretty unusual for you lot. I grew up where quakes were common. They were hardly worth mentioning until they were in the high sixes ?? That yours was so shallow probably altered perceptions relative to the Richter scale. I’ll bet it felt much stronger than what I normally associate with 5.9 strength.

    WP doesn’t do sitemaps by default, yours are implemented by your theme or a plugin. Sitemaps are commonly implemented from SEO plugins. You might be able to alter the existing sitemaps to suit your needs via filtering. That would be something to ask through the dedicated support channel of the responsible theme or plugin.

    There’s likely a way to fully disable plugin sitemap functionality. Once disabled, you could implement your own static file without it being overridden. Actually, a physical file should always override “virtual” files fulfilled by the plugin, whether disabled or not.

    However, you cannot place a physical file in the subsite folder since it does not physically exist. Creating a physical folder would break the subsite. By “physical” I mean an actual server file that exists magnetically on server drives or electronically in server SSDs. The “virtual” files are implemented through WP plugin code once no physical files of the same name are found to exist.

    You could code the sitemap file as a PHP file. It would send appropriate headers and XML content that search engines are expecting. It can do one thing or another based on whether the subsite sitemap was requested or not. You’d also need a .htaccess redirect the sends subsite sitemap requests to this PHP file. The PHP file can tell what the original request was from values in the $_SERVER array.

    Thread Starter iwishyouthebestofthebest

    (@iwishyouthebestofthebest)

    Hello bcworkz and thank you very much for your reply!

    As for the earthquake, then I found out that since I started feeling the vibrations and all the time I felt them my grandmother was in the bathroom, then when she went out the vibrations stopped. I told her not to overdo the beans …

    As for your second paragraph, I understand. Then they are implemented by my theme, because I don’t have any SEO plugins installed, and I’ll try to ask them if anything can be done.

    As for your third paragraph, I agree with your first sentence; as for the next sentence, I would like to specify that my file already overwrites the sitemap created by the theme, but it does so only in the case of the main site, while, in the case of the sub-site, the same sitemap created by default is always shown. So what you say in your last sentence in this case is proven.

    As for your fourth paragraph, yes, I realized that there is no folder for the subsite, and I agree with what you said about creating a folder for the subsite, because, when I did, the site it stopped. For the rest, good to know ??

    As for your fifth and last paragraph, thank you for the information, only I still have little knowledge of PHP, and I don’t know how to create this file, where to put it, how to compile the .htaccess file etc. Do you know if there are example files for this purpose, or ready-made files that you can adapt to your needs?

    In any case, thank you very much and I wish you a wonderful continuation

    A warm greeting

    Thread Starter iwishyouthebestofthebest

    (@iwishyouthebestofthebest)

    Hi again bcworkz
    I found this post, I invite you to take a look:

    New XML Sitemaps Functionality in WordPress 5.5


    It presents a new functionality of WordPress (the creation of predefined sitemaps [the one that I thought WordPress had, and in fact has]), which can also be customized.

    Would you be kind enough to help me customize them for my needs?

    A warm greeting

    Moderator bcworkz

    (@bcworkz)

    Ah damn! You know, with your last message I realized that I did see that post in “Make” (the sub-domain). But I then soon forgot about it ?? Hopefully with your reminder I’ll remember going forward. I remember better when I embarrassingly get called out for passing on out-of-date information.

    I’m not sure I follow what you actually want to do. Your complaint is the sitemaps don’t link to each other. They normally wouldn’t since each network site is supposed to be considered a completely independent, separate website. You apparently have a different schema where the sites do relate. That’s fine, it’s just a departure from “normal”.

    While you can disable default sitemap functionality and create your own, that seems like overkill if all you really need is a couple extra links tying the sitemaps together. Actually, wouldn’t you just need one link on the main sitemap that links to the sub-site map? Since it’s subsidiary to the main map, there’s no need to link back up the hierarchy.

    You could just add a link to the sub-site map on the main index map page. It appears like you’d need to add a new provider to do so. A lot of fuss for one link and a bit hacky since this provider is supposed to map links as well, but we just want to add an index link to an existing map.

    OTOH, if your site will rarely change, perhaps disabling and creating a static sitemap isn’t so much overkill after all. What I said earlier about using PHP to generate appropriate output isn’t necessary if you were to include all subsite links in your one static sitemap file. There are websites that will auto-generate static sitemap files based on links it finds on your site. Thus the main site would need a link to the sub-site somewhere so all the sub-site links get picked up as well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Where to insert sitemaps in WordPress multisite without plugins’ is closed to new replies.