Multi-lingual SEO & Sitemap

Multi-lingual SEO & Sitemap plugin. It supports CMS Pages, Static Pages and custom models.

Back to Multi-lingual SEO & Sitemap Support

MateThemes
MateThemes

Hello! Thank you for your plugin!!! The only thing is, that my sitemap.xml has not markup. I cant find any error or something! May you can help with this! Thanks a lot

Utopig Studio
Utopig Studio

Yes, this is a known issue. The sitemap follows the recommendations from google https://support.google.com/webmasters/answer/189077?hl=en&visit_id=636866786973497523-1860492156&rd=1. I tried to solve this problem following the accepted solution in this stackoverflow link: https://stackoverflow.com/questions/51923627/xml-sitemap-rendering-as-plain-text, but when I did it, google didn't accept the sitemap. So yes it's an open issue. If anyone knows how to solve it, the repo is totally open to pull requests :)

MateThemes
MateThemes

Hello! I think I have found the error.

you have this code in your models/sitemap.php

protected function makeUrlSet()
    {
        if ($this->urlSet !== null) {
            return $this->urlSet;
        }

        $xml = $this->makeXmlObject();
        $urlSet = $xml->createElement('urlset');
        $urlSet->setAttribute('xmlns', 'https://www.sitemaps.org/schemas/sitemap/0.9');
        $urlSet->setAttribute('xmlns:xhtml', 'https://www.w3.org/1999/xhtml');
        $urlSet->setAttribute('xmlns:xsi', 'https://www.w3.org/2001/XMLSchema-instance');
        $urlSet->setAttribute('xsi:schemaLocation', 'https://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd');

        return $this->urlSet = $urlSet;
    }

I have changed the URL's to https and now i works fine for me.

Utopig Studio
Utopig Studio

You absolutelly rule! Thank you very much! We will update the plugin ASAP :)

Utopig Studio
Utopig Studio

Fixed! Thanks again

Utopig Studio
Utopig Studio

Unfortunately, the https fix is not correctly parsed by google search console so I had to remove it :(

jaans
jaans

I got exactly the same error. Strange I looked, you made changes, but still there was the same problem. I have now changed in the file models/Sitemap.php In method generateSitemap($protocol = 'https') http to https And of course replaced the property protected $protocol = 'https'; http to https Everything works fine

Publipresse
Publipresse

Personnally, even with the https fix, I still see the sitemap as raw text

Utopig Studio
Utopig Studio

Hi Publipresse, do you see this sitemap https://utopigstudio.com/sitemap-debug.xml as raw text? I see it perfectly in firefox and chrome also

rupert24306
rupert24306

I thought I had this same problem, but when I checked I found that the XML file just appeared like plain text, but was actually valid XML.

It seems that the file definition to enable multiple languages somehow messes up the human display in the browser.

Last updated

1-10 of 10