Skip Navigation

[Resolved] Problem in sitemaps generated with Rank Math (re-open)

This support ticket is created 2 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 10 replies, has 2 voices.

Last updated by hernanL 2 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#2473503
Captura desde 2022-10-03 14-13-38.png

Randomly I have a major problem with my sitemap

Here is the original thread, since it's been 12 hours I can't reopen it

https://toolset.com/forums/topic/problem-in-sitemaps-generated-with-rank-math/

Summarizing the problem. I have inserted the following code snippet to be able to occupy GeneratePress blocks in Toolset:

https://toolset.com/errata/generateblocks-styles-lost-on-front-end-when-using-content-templates/

The snippet is functional, I can use all the blocks that I need. BUT it is randomly inserting styles to my sitemap, which is causing an error in google search console

The sitemap that is randomly affected is this:

hidden link

Randomly the browser itself throws the following error:

Error de lectura XML: contenido incorrecto tras un elemento XML del documento
Ubicación: <em><u>hidden link</u></em>
Número de línea 1, columna 116:
<div class="tces-js-style-encoded" style="display:none;">LnRiLWhlYWRpbmcuaGFzLWJhY2tncm91bmR7cGFkZGluZzowfQ==</div><script class="tces-js-style-to-head">toolsetCommonEs.styleToHead()</script><?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//femininescorts.cl/main-sitemap.xsl"?>
-------------------------------------------------------------------------------------------------------------------^

By removing GeneratePress blocks I have reduced the number of times it generates an error but it randomly reappears

I really need a hand, I'm considering removing all the generatepress blocks on the whole site and removing that code snippet (I would have to rethink and redesign an essential part of the website)

#2473609

I have noticed that I can disable the code snippet (I am using the "Code Snippets" plugin to insert code in functions.php) the templates are not affected (I imagine that if I edit them without the code snippet enabled I will lose the styles)

In any case, I would appreciate if someone with knowledge could review my case. I'm not even completely sure if the problem was the code snippet, maybe the problem comes back

#2473851

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What if instead of using the "Code Snippet" if you try to add the code shared directly to your theme's functions.php file - Do you see any difference?

In addition to that I would like to have debug information that will help us to debug and investigate your issue:
- https://toolset.com/faq/provide-debug-information-faster-support/

#2474315

Thank you very much I really need a hand

Today I am without the code snippet but the problem persists randomly (it is always the same sitemap that is corrupted by the toolset styles)

hidden link

#2474321

By the way I filled in the debug information

Since styles are randomly inserted into the sitemap, I've created a test environment where the sitemap is more likely to fail (I've noticed that the sitemap is more likely to be corrupted by mixing GeneratePress blocks into a Toolset block, avoiding this is less likely but it still happens)

hidden link
If you click a couple of times in normal or incognito mode I'm pretty sure you'll be able to replicate the error

The sandbox also has less adult content to make it more comfortable to review in the work environment

#2474549

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

First of all, I tried to check and reproduce the issue but I could not.

I can see sitemap is working as expected without any issue.

Further I found that your site is hosted on cloudflare so there is a great chance that there is a server or CDN cache and due to that you experience the issue.

Would you mind to try on another server without cloudflare and there is no CDN involve and check if that help you to resolver your issue.

#2474781

Too bad the error didn't come out, sometimes it seemed really random

Today I have been able to replicate the error at will in an environment without a CDN, I am also excluding the sitemaps in the LiteSpeed ​​plugin. Finally it was NOT the mix of blocks. On my home page I have a toolset view (it is the absolute center of the web page) when modifying the template the next reading of the sitemap will be corrupted with toolset styles

That is probably why I am the first person to report the problem, the first day it will generate an error but the following ones (if no further modification has been made to the template) will be correct. Also you have to go to the sitemap list in google search console to see the error, the main sitemap always looks fine (although corrupted sitemap links are not counted)

I think this can happen to everyone who uses toolset and rankmath together. In the immediate term, if I make changes to the main view template, I will make sure that the error is received by me and not by Google. Now I can take it more calmly, I don't have a special hurry or urgency

I can ask hostinger or rank math (I already asked rank math, they suggested I ask you first) do you have any idea why this is happening? why will the toolset styles be the ones that sneak in?

By the way, now I have prepared the following sitemap so that it generates an error (if you want to consult the normal sitemap, you just have to click on refresh)

hidden link

That is only the first click, if you need me to trigger the error again I have to modify the main view template again

#2474869

When removing the CDN from the test environment, I failed the addresses (I have it linked to the domain itself, it would cost me a lot to disable it for testing)

But I've prepared a new test environment so you can see a corrupted sitemap:

hidden link

Please let me know if you don't see it, I can force the error again (I just have to modify the view template with random text). The error only appears on the first visit

#2475379

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I still not able to see the issue as you described on the first load.

Here is the sandbox site, you can autologin to it using the following link:
- hidden link

Can you please setup a test there for me and also share the steps to reproduce the issue.

#2475721
Captura desde 2022-10-13 16-09-14.png
Captura desde 2022-10-13 16-08-57.png
Captura desde 2022-10-13 16-05-18.png

I couldn't create a working sitemap in your test environment (requires additional settings for nginx server)

It is very strange that you could not see the error, I was able to visit it with my visit (maybe you clicked on the wrong sitemap) anyway I left it ready for the next visit it throws an error

hidden link

The truth is that I prefer to close the ticket by time, I am immediately satisfied with my sitemap. I'm taking screenshots anyway, I've also copied an example of a corrupted sitemap into a plain html file for you to analyze. The CSS class that is sneaked is called "tces-js-style-to-head" and the function that inserts the code is called "toolsetCommonEs.styleToHead()" is at the beginning of the sitemap

Here is a transcript of part of the sitemap (the toolset style is at the beginning) to give you an idea:

<urlset xmlns:xsi="<em><u>hidden link</u></em>" xmlns:image="<em><u>hidden link</u></em>" xsi:schemaLocation="<em><u>hidden link</u></em> <em><u>hidden link</u></em> <em><u>hidden link</u></em> <em><u>hidden link</u></em>" xmlns="<em><u>hidden link</u></em>">
	<url>
		<loc><em><u>hidden link</u></em>;
		<lastmod>2022-10-13T12:05:18-03:00</lastmod>
		<image:image>
			<image:loc><em><u>hidden link</u></em>;
		</image:image>
		<image:image>
			<image:loc><em><u>hidden link</u></em>;
		</image:image>

And continue normal

I will do something similar in Ran Math, I will document my case as best as possible so that it can be considered as a bug report. Luckily the style is inserted only on the first visit, so I'll just avoid modifying my main view block (or if I do I'll make sure I'm the first visit to the pages sitemap myself)

Anyway thank you very much

#2475747

My issue is resolved now. Thank you!