Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2022-06-30 09:57:41

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Google Search Console and sitemap

hi!

submitted sitemap on search console and get error notice:

An invalid date was found. Please fix the date or formatting before resubmitting.
Examples
Line 13
Parent tag: url
Tag: lastmod

my template:

<txp:header name="Content-Type" value="application/xml; charset=utf-8" />
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc><txp:site_url /></loc></url>
<txp:section_list exclude="sitemap,muu,various,test,otsing" break="">
<url><loc><txp:site_url /><txp:section />/</loc></url>
</txp:section_list>
<txp:article_custom section="minust,maalid,blogi" break="url" wraptag="" limit="9999">
<loc><txp:permlink /></loc>
<lastmod><txp:modified format="%Y-%m-%dT%H:%M:%SZ" /></lastmod>
</txp:article_custom>
</urlset>

and sitemap

how to fix it? it used to worked well for google, something has changed

Offline

#2 2022-06-30 11:36:19

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: Google Search Console and sitemap

I think it’s due to the T and Z not being escaped in your timestamp. You need to either do \T and Z or – as noted in a recent topic on the forum – you can use:

<lastmod><txp:modified format="w3c" /></lastmod>

which I think outputs the correct format, or simplify it to:

<lastmod><txp:modified format="%Y-%m-%d" /></lastmod>

Unless you’re a breaking news site or you post at times very near timezone changes, the minutes and seconds are largerly irrelevant.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2022-06-30 11:41:49

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: Google Search Console and sitemap

Julian was faster, I was going to point to a similar thread

I’ve used format="w3c" for a while (since TXP v4.8.8 I think) and that seems to be acceptable for search engines.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2022-06-30 11:44:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: Google Search Console and sitemap

Hehe, was editing while you posted to add the link to that thread… “Great minds” ;-)


TXP Builders – finely-crafted code, design and txp

Offline

#5 2022-06-30 12:17:46

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: Google Search Console and sitemap

brilliant! thank you guys!

Offline

#6 2022-07-04 14:20:03

arjayarana
Member
Registered: 2022-06-27
Posts: 14

Re: Google Search Console and sitemap

Hi all. I’ve submitted my sitemap to Google Search Console, and I’m experiencing this same issue. However, I’m using the plugin rah_sitemap and so I don’t know how to make the changes suggested here.

If I have to make a manual sitemap template instead of using the plugin, I will try to do that. But I’m still new to TXP, so I don’t know where to start.

Below is some code from my sitemap, which shows the problematic time stamp:

<url>
<loc>
https://www.arjayarana.xyz/blog1/rebuilding-this-blog-in-textpattern
</loc>
<lastmod>2022-06-29T06:08:55+0000</lastmod>
</url>

Offline

#7 2022-07-04 15:05:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: Google Search Console and sitemap

Hi arjayarana,
You can check out how the NeMe site sitemap works where we have a section called sitemap.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#8 2022-07-04 22:09:48

arjayarana
Member
Registered: 2022-06-27
Posts: 14

Re: Google Search Console and sitemap

colak wrote #333670:

Hi arjayarana,
You can check out how the NeMe site sitemap works where we have a section called sitemap.

Thank you!

And later I will also look at the rest of the source code to learn Txp :)

Offline

Board footer

Powered by FluxBB