+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Cronjob not updating sitemap.xml

  1. #1

    Cronjob not updating sitemap.xml

    I did a test increasing cronjob to every 5 min but the sitemap didn't update the listing.xml even if there was a new listings.
    Why doesn't the listings.xml get updated on cronrun? Isn't this why we also use sitemaps, to tell google bots that new listings have been added?

    What decides when the listings.xml are updated?
    Shouldn't that be updated like every time a new listing is added to the site or removed so the spiders know where to look.
    Last edited by Peter Jonsson; February 20, 2022 at 09:24 PM.
    Classifieds Site: Annonssida
    Other Site: SEO

  2. #2
    Anyone have any comment on this one?
    Classifieds Site: Annonssida
    Other Site: SEO

  3. #3
    Master
    Join Date
    Jun 2017
    Location
    Fukushima
    Posts
    299
    Quote Originally Posted by Peter Jonsson View Post
    Anyone have any comment on this one?
    I'm having the same issue. Still have to update it manually...
    Any solution will be highly appreciated.

  4. #4
    Quote Originally Posted by Skorpion View Post
    I'm having the same issue. Still have to update it manually...
    Any solution will be highly appreciated.
    How do you update it manually?
    I did the rebuild xml but that didn't add any of the new listings
    Classifieds Site: Annonssida
    Other Site: SEO

  5. #5
    Quote Originally Posted by Peter Jonsson View Post
    I did a test increasing cronjob to every 5 min but the sitemap didn't update the listing.xml even if there was a new listings.
    Why doesn't the listings.xml get updated on cronrun? Isn't this why we also use sitemaps, to tell google bots that new listings have been added?

    What decides when the listings.xml are updated?
    Shouldn't that be updated like every time a new listing is added to the site or removed so the spiders know where to look.
    Hello Peter,

    So, by default the Sitemap plugin have 3 different ways for rebuild XML files in the sitemap:
    - you update manually via Admin panel > Common > Refresh > Update sitemap.xml file = Rebuild. It will always remove exist sitemap files and build a new.
    - via cron jobs. If your crontab configured properly that cron file will check XML file: it will create it if files missing; it will updated if last date of modifying files more then 24hours
    - via frontend: if files is missing and get a request your-domain.com/sitemap.xml the plugin will create it. It wouldn't update files if they are exist already.


    If your cron doesn't update old files, that maybe it have a errors.
    You can check it manually:
    - rename file /cron/.htaccess to backup.htaccess for example
    - run cron script via browser your-domain.com/cron/index.php
    If it return empty content that cron works properly and doesn't have errors.
    Thank you, Curtis.
    @Flynax Company

  6. #6
    I changed name on htaccess, run the script and it was a blank page.

    Went to files/sitemap and the only file that was updated was sitemap.xml
    not the sitemap_account1.xml, sitemap_categories1.xml, sitemap_listings1.xml and sitemap_pages1.xml
    Classifieds Site: Annonssida
    Other Site: SEO

  7. #7
    Curtis says:
    via cron jobs. If your crontab configured properly that cron file will check XML file: it will create it if files missing; it will updated if last date of modifying files more then 24hours
    Last edited by Bahram Soltanirad; February 22, 2022 at 11:35 AM.

  8. #8
    Quote Originally Posted by Bahram Soltanirad View Post
    via cron jobs. If your crontab configured properly that cron file will check XML file: it will create it if files missing; it will updated if last date of modifying files more then 24hours
    But it should update every time the cron is running. If new listing are added or removed from site it should change the listings.xml every time the cron is running to keep the content up to date. Not updating every 24hours.

    Why is the sitemap.xml updating every time the cron is running but not updating the account, listings, pages xml etc etc ?


    the sitemap.xml shows this: <lastmod>2022-02-22T12:39:01+00:00</lastmod> for all the sitemaps but this is wrong as the sitemap files aren't updated with new and removed listings
    Last edited by Peter Jonsson; February 22, 2022 at 11:42 AM.
    Classifieds Site: Annonssida
    Other Site: SEO

  9. #9
    If you'd like to update xml files every time the cron is running, then

    go to sitemap plugin folder/rlSitemap.class.php

    Find:
    Code:
    Only registered members can view the code.
    Change to:
    Code:
    Only registered members can view the code.
    Last edited by Bahram Soltanirad; February 22, 2022 at 12:14 PM.

  10. #10
    Quote Originally Posted by Bahram Soltanirad View Post
    If you'd like to update xml files every time the cron is running, then

    go to sitemap plugin folder/rlSitemap.class.php

    Find:
    Code:
    Only registered members can view the code.
    Change to:
    Code:
    Only registered members can view the code.
    With your change it doesn't seem to work at all.
    I just changed 86400 to the time I wanted.

    Thanks for your help <3
    Last edited by Peter Jonsson; February 22, 2022 at 01:48 PM.
    Classifieds Site: Annonssida
    Other Site: SEO

+ Reply to Thread