Need help in the process of creating your own WordPress theme?
Generates the sitemap.xml
file for search engines.
/**
* Search engines where to report about the sitemap existence.
* By default the extension supports only Google and Bing.
*/
$cfg['search_engines'] = array('google', 'bing');
/**
* The frequency of the sitemap refresh (measured in days).
*/
$cfg['sitemap_refresh_rate'] = 2;
/**
* Exclude post types from sitemap indexing.
*/
$cfg['excluded_post_types'] = array('attachment');
/**
* Exclude taxonomies from sitemap indexing.
*/
$cfg['excluded_taxonomies'] = array('post_tag');
/**
* Setup the URL frequency and priority for each post_type, taxonomy and the homepage
*/
$cfg['url_settings'] = array(
'home' => array(
'priority' => 1,
'frequency' => 'daily',
),
'posts' => array(
'priority' => 0.6,
'frequency' => 'daily',
/**
* In case you have specific posts type that you want to set different settings
*/
'type' => array(
'page' => array(
'priority' => 0.5,
'frequency' => 'weekly',
)
)
),
'taxonomies' => array(
'priority' => 0.4,
'frequency' => 'weekly',
/**
* In case you have specific taxonomy that you want to set different settings
*/
'type' => array(
'post_tag' => array(
'priority' => 0.3,
'frequency' => 'weekly',
)
)
)
);
There are 3 views you can customize:
sitemap-header.php
- Header content for the sitemap.xml
file.sitemap.php
- Content for the sitemap.xml
file. You can edit this file in case you want to exclude some items from sitemap.sitemap-style.php
- Gives sitemap a user friendly view when it’s accessed in the browser.fw_ext_seo_sitemap_date_format
- Filter to change the date format of the last modified date in sitemap./** @internal */
function _filter_modify_sitemap_date_format( $format ) {
return 'Y M, d';
}
add_filter('fw_ext_seo_sitemap_date_format', '_filter_modify_sitemap_date_format');
fw_ext_seo_sitemap_pre_update
- Action fired when the sitemap prepares to be updated.fw_ext_seo_sitemap_updated
- Action fired after the sitemap was updated.fw_ext_seo_sitemap_pre_delete
- Action fired when the sitemap prepares to be deleted.fw_ext_seo_sitemap_deleted
- Action fired after the sitemap was deleted.