Generating Sitemap

There are three built-in ways to generate a sitemap for all publicly viewable pages.

All three will generate a sitemap-index.xml file as well as sitemaps for individual content types.

You only need to submit a link to sitemap-index.xml file (or the file itself) to google or another search engine. Sitemap files will be stored in public/storage/sitemaps folder on your server, it should be accessible via https://your-site.com/storage/sitemaps/sitemap-index.xml url.

1. Settings page

Sitemap can be generated from admin -> settings -> general page, by clicking generate sitemap button.

Depending on the number of records, sitemap generation can take longer then the maximum request time allowed by hosting provider (eg. it takes 3 minutes to generate sitemap and maximum request time is set to 2 minutes), in this case sitemap would only be generated partially. You can either remove this limit from your server or use the other two methods listed below.

2. Command line

If you have access to command line on your server, you can use the command below to generate sitemap:

php /path/to/installation/folder/artisan sitemap:generate

3. CRON

You can create a cron job from your hosting provider's control panel to generate sitemap periodically, similar to main CRON job, you've created. You can use the command below:

php /path/to/installation/folder/artisan sitemap:generate

This CRON job should run only once a day or once a week.