• Resolved lucasnascimento

    (@lucasnascimento)


    Hello guys! Hope you guys are well.

    I’m opening this thread because of a strange problem that is happening with my website https://radiomanchete.rio and Google News.

    I’m using Smart Crawl as my SEO plugin, as well as GN Publisher as my google news optimized feed generator.

    I even had opened a support thread with GN Publisher guys about this issue: (https://www.ads-software.com/support/topic/my-feeds-are-being-generated-with-wrong-timezone/)

    Shortening the situation: We believe google news may be retrieving wrong publish time for my posts because of the schema tags. Guys at GN suggested me to add an offset at my schema “datePublished” property, to see if this can correct the issue. Would that be possible?

    I have another website, https://fup.org.br that is on google news as well, using both smartcrawl and GN publisher, and have no problems with incorrect timezone.

    If you need more information, I’d gladly share with you.

    Your help would be much appreciated. Thank you!

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @lucasnascimento,

    Given that your website is experiencing this issue and your other website?(which uses the same plugins) doesn’t, it’s possible that there might be some other differences in configuration between the two sites causing this or any potential conflict.

    Just to be sure, have you compared both settings to see whether there are any differences? ie do you use Postdate or Post Date GMT for the “DatePublished” property? Does it make any difference if Postdate or Postdate GMT switched or vice versa?

    Since GN is a 3rd party plugin what we know regarding its worklow is limited. I’m afraid, we cannot say for sure how it’ll behave after adding an offset since the existing value for the datePublished isn’t picked on the Google News side either.

    By default there isn’t any feature to add the offset, so in order to see if there is any workaround that could be suggested, possible to share a screenshot of the current schema that you have configured?

    Looking forward to your response.

    Kind Regards,

    Nithin

    Thread Starter lucasnascimento

    (@lucasnascimento)

    Hi Nithin!

    I’m sorry, but I don’t know how could I check if I’m using post date or post date gmt. Would it be just checking my publish time in schema vs. in my database?

    Also, meanwhile, I could find where smart crawl defines schema timestamp, and changed in the php file the datetime format, including an “O” in the end. Now my datePublished and dateModified fields in the schema show my UTC in the end, which is -03:00.

    After I changed this, two new posts were crawled by Google news, but still had no effect; they were just posted there with a “4 hours ago” in Google news.

    Thread Starter lucasnascimento

    (@lucasnascimento)

    [update]

    I’m also digging every datetime that could be related to the wrong publish time by google, and I noticed that in my news sitemap, I don’t really know if this is a mistake, but my publish dates are with the wrong offset…

    https://freeimage.host/i/HQqvV0F – If you notice in the image, in my news sitemap xml, it is showing the publish date and time as 13:41, which is correct, according to my post publish time but with a +00:00 in the end, as if it was UTC time. Wouldn’t the correct be 13:41 but with a -03:00 in the end, indicating Brazil’s GMT -3 timestamp?

    Please correct me if I’m wrong. Thank you very much for your assistance.

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @lucasnascimento

    Thanks for update!

    I just read entire other topic (the one you started with GN support) and do I correctly understand that changes in SmartCrawl, as described in this reply

    https://www.ads-software.com/support/topic/my-feeds-are-being-generated-with-wrong-timezone/page/2/#post-16915312

    did solve the issue?

    I must admit I didn’t find any other reports of such issue in our internal bug tracking system but it may be something to further investigate. I’d just want to confirm first if those changes in the code worked for you after all.

    As for that +00:00 part – technically speaking that should be an offset but it should make no difference here for as long as actual time is correct. There is one thing, however, that makes me wondering:

    you mentioned earlier that the “preview” at Google was showing correct time anyway and only the “live” version was incorrect; with changes that you made to the plugin there’s no more such discrepancy as well, right?

    Also, aside from using GN plugin, do you also have any types set in “SmartCrawl -> Schema -> Types Builder”?

    Best regards,
    Adam

    Thread Starter lucasnascimento

    (@lucasnascimento)

    Hi Adam! How are you?

    Indeed, the changes that I made solved the issue. Now my google news page display the correct publish times, aligned with the publish times that appear in my google news preview, and also with my correct post publish times.

    Answering to your questions, now the discrepancy is really gone, and I don’t have any schema types set in the types builder.

    I’ll describe briefly the problem and the changes that I made, so other people that have the same problem may find it.

    My website has as timezone UTC -3, as we are in America/S?o Paulo (Brazil) timezone. When I subscribed my website for Google News, I noticed that my preview showed the correct publish time for the news retrieved, but my live publication doesn’t. It showed a 4-hours offset, so even an instanly fetched post appeared published as “4 hours ago”.

    In my investigations, I tried changing the timezone either in my server, in my PHP environment, and in my wordpress configs, with no success in any of the attempts. Finally, when I narrowed my research, I ended up between 2 potential sources of the issue – GN Publisher (a plugin to generate Google News specific feeds) and Smartcrawl, that generates my post metatags, schema and news sitemaps.

    After more research, we assumed GN Publisher was generating the feeds with the correct timezone, so focusing in smartcrawl, I digged and found two places that set the datetime markups for my posts, it was in the metatags (article:published time property) and in the schema (datePublished and dateModified properties).

    I noticed that smartcrawl was generating my publish times with the PHP date format “Y-m-d\TH:i:s”, having as output a “YYYY-MM-DDTHH:MM:ss” formatted datetime. This output was set this way both in my metatag as in my shema output. However, in the Google News best practices manual, they point out that datetime must be in ISO8601 format. In the PHP documentation, ISO8601 format should be “Y-m-d\TH:i:sO”, but this gave me an output of “YYYY-MM-DDTHH:MM:ss-0300”, and after testing, it didn’t solve my issue. So I manually changed the format to “Y-m-d\TH:i:sP” in the plugin files and this returned “YYYY-MM-DDTHH:MM:ss-03:00”. Finally, after doing this, the problem was gone and Google News now recognized my posts at the correct times they were being published.

    Today I noticed something that may be relevant: My website is using PHP 8.2.8, and as we can see here: https://freeimage.host/i/HQVdaaf, it looks like the “P” in the date format is something from PHP version 8 on. This could explain why my website https://fup.org.br, which I told about in the beginning of this thread, doesn’t have this problem, as it uses exactly the same plugins but uses PHP 7.4.

    The files that I changed were “wp-content/plugins/smartcrawl-seo/includes/core/schema/fragments/class-post.php” in lines 62 and 63 (for the datePublished and dateModified schema markups) and “wp-content/plugins/smartcrawl-seo/includes/core/entities/class-post.php” in line 683 (for the article:published_time metatag).

    If anyone has the same problem as me, I hope this explanation helps to point out some starting point for research, er even the complete solution =).

    Adam, I also hope that this can help you guys at WPMU Dev somehow track and reproduce this issue, if possible, and apply a solution! I’m also available to give any other information needed. Thank you guys for the support!

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @lucasnascimento

    Thank you for response and for sharing this summary!

    It’s a very comprehensive and clear explanation and I’m sure it may help some other people.

    I also agree that the difference in PHP version on sites seems to be related – and explain why on one of the sites the issue didn’t happen.

    We didn’t have any similar reports so far but it’s quite possible that some affected admins simply didn’t notice it yet (like we didn’t as well).

    So I’m forwarding this to our SmartCrawl Team for further review and investigation. They’ll look into it and check code so if necessary they’ll be able to include needed fixes in one of future release.

    Thank you for pointing it out and for great research on the issue! I’m aware that this was a lot of work and effort on your site and we appreciate it a lot!

    Best regards,
    Adam

    Thread Starter lucasnascimento

    (@lucasnascimento)

    Thanks for the kind words, Adam! I’ve always been an enthusiast of the WPMU products, and Smartcrawl and Smush are two “musts” on every website that I make.

    I’m glad to hear that all this information above may be helpful, and would like to thank you and WPMU guys for the awesome work!

    Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @lucasnascimento,

    I hope you are doing well today!

    It’s wonderful to hear that you’re an enthusiast of WPMU products, and that you find Smartcrawl and Smush essential for your websites. Your kind words and support are greatly appreciated, and we’d also like to thank you for using our products. It’s always rewarding to know that our efforts have been useful in making your web development journey easier.

    We are marking this thread as resolved. If you have any other issues or queries related to our products, feel free to reach out. We’re always here to help.

    Kind regards,
    Zafer

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Google News posts being generated with wrong timezone, possibly due to schema’ is closed to new replies.