1. Go to this page and download the library: Download jorisnoo/craft-sitemap library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
return [
// Skip all entries in these section handles
'excludeSections' => ['private', 'drafts'],
// Skip all entries of these entry type handles (e.g. entries that only redirect elsewhere)
'excludeEntryTypes' => ['externalLink'],
// Skip all categories in these group handles
'excludeCategoryGroups' => ['internal'],
// Skip URIs matching any of these glob patterns (matched against the element URI)
'excludeUriPatterns' => ['legal/*', 'private'],
// robots.txt rules; the Sitemap line is appended automatically
'robots' => <<<'TXT'
User-agent: *
Disallow: /cache/
User-agent: GPTBot
Disallow: /
TXT,
];
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.