XML Sitemap & Google News 5.7.7 has 37 actions and 48 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when XML Sitemap & Google News fires an action
add_action( 'xmlsf_sitemap_loaded', function( $arg1, $request ) {
// Your code runs here.
}, 10, 2 );
// Change a value XML Sitemap & Google News is about to use
add_filter( 'xmlsf_author_has_published_posts', function( $post_types ) {
// Change $post_types here.
return $post_types;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Filters the has_published_posts query argument in the author archive. Must * return a boolean or an array of one or multiple post types. Allows to add or * change post type when theme author archive page shows custom post types. */ apply_filters( 'xmlsf_author_has_published_posts', $post_types ); -
wp_sitemaps_index_entry
filter/** * Filters the sitemap entry for the sitemap index. */ apply_filters( 'wp_sitemaps_index_entry', $sitemap_entry, $this->object_type, '', $page ); -
xmlsf_sitemap_loaded
action/** * IT'S A SITEMAP */ do_action( 'xmlsf_sitemap_loaded', 'core', $request['sitemap'] ); -
wp_sitemaps_urls_entry
filter/** * Filters the sitemap entry for an individual post. */ apply_filters( 'wp_sitemaps_urls_entry', $sitemap_entry, $url ); -
xmlsf_blogpages
filter/** * Filter blogpages */ apply_filters( 'xmlsf_blogpages', $blogpage ); -
xmlsf_core_request
filter/** * Developers: add your actions that should run when a sitemap request is with: */ apply_filters( 'xmlsf_core_request', $request ); -
xmlsf_frontpages
filter/** * Filter frontpages */ apply_filters( 'xmlsf_frontpages', $frontpage ); -
xmlsf_news_request
filter/** * Developers */ apply_filters( 'xmlsf_news_request', $request ); -
xmlsf_news_sitemap_loaded
action/** * IT'S A NEWS SITEMAP */ do_action( 'xmlsf_news_sitemap_loaded' ); -
/** * Pre-filter the return value of get_lastpostmodified() before the query is * run. */ apply_filters( 'xmlsf_pre_get_lastpostmodified', false, $subtype, $page ); -
/** * Pre-filter the return value of get_taxonomy_modified() before the query is * run. */ apply_filters( 'xmlsf_pre_get_taxonomy_modified', false, $taxonomy, $page ); -
xmlsf_request
filter/** * Filters the request. */ apply_filters( 'xmlsf_request', $request ); -
xmlsf_root_data
filter/** * Developers */ apply_filters( 'xmlsf_root_data', $home_pages ); -
xmlsf_advanced_enabled
filterapply_filters( 'xmlsf_advanced_enabled', false ); -
xmlsf_news_advanced_enabled
filterapply_filters( 'xmlsf_news_advanced_enabled', false ); -
xmlsf_generator
actiondo_action( 'xmlsf_generator' ); -
xmlsf_tags_after
actiondo_action( 'xmlsf_tags_after', 'author', $user ); -
xmlsf_url
actiondo_action( 'xmlsf_url', 'author', $user ); -
xmlsf_url_after
actiondo_action( 'xmlsf_url_after', 'author', $user, $data ); -
xmlsf_urlset
actiondo_action( 'xmlsf_urlset', 'home' ); -
wpml_switch_language
actiondo_action( 'wpml_switch_language', $code ); -
xmlsf_entry_url
filterapply_filters( 'xmlsf_entry_url', get_author_posts_url( $user->ID ), 'author', $user ); -
do_action( 'sitemap_notifier_refresh_access_token_error', $error, 'error' ); -
xmlsf_custom_urls
filterapply_filters( 'xmlsf_custom_urls', (array) \get_option( 'xmlsf_urls', array() ) ); -
xmlsf_sitemaps_enabled
filterapply_filters( 'xmlsf_sitemaps_enabled', $return, $which ); -
do_action( 'sitemap_notifier_manual_submission', $message, $status ); -
wpml_active_languages
filterapply_filters( 'wpml_active_languages', null ); -
wpml_default_language
filterapply_filters( 'wpml_default_language', null ); -
xmlsf_admin_sidebar
actiondo_action( 'xmlsf_admin_sidebar', 'news' ); -
xmlsf_custom_sitemaps
filterapply_filters( 'xmlsf_custom_sitemaps', (array) \get_option( 'xmlsf_custom_sitemaps', array() ) ); -
xmlsf_index_archive_data
filterapply_filters( 'xmlsf_index_archive_data', array(), $post_type, $archive ); -
xmlsf_news_post_types
filterapply_filters( 'xmlsf_news_post_types', $post_types ); -
do_action( 'xmlsf_nginx_helper_purge_urls', $urls ); -
do_action( 'xmlsf_register_sitemap_provider' ); -
do_action( 'xmlsf_register_sitemap_provider_after' ); -
xmlsf_sitemap_news_slug
filterapply_filters( 'xmlsf_sitemap_news_slug', 'sitemap-news' ); -
xmlsf_sitemap_slug
filterapply_filters( 'xmlsf_sitemap_slug', 'wp-sitemap' ); -
xmlsf_sitemap_url
filterapply_filters( 'xmlsf_sitemap_url', $sitemap_url, $sitemap ); -
xmlsf_taxonomies_query_args
filterapply_filters( 'xmlsf_taxonomies_query_args', array( 'taxonomy' => $the_taxonomy, 'number' => $limit, 'hide_empty' => true, 'hierarchical' => false, 'update_term_meta_cache' => false, ), $the_taxonomy ); -
get_firstpostdate
filterapply_filters( 'get_firstpostdate', _get_post_time( $timezone, 'date', $post_type, 'first' ), $timezone ); -
get_lastmodified
filterapply_filters( 'get_lastmodified', $modified, $timezone ); -
do_action( 'sitemap_notifier_manual_submission_news', $message, $status ); -
wpml_permalink
filterapply_filters( 'wpml_permalink', $url ); -
xmlsf_add_settings
actiondo_action( 'xmlsf_add_settings', $active_tab ); -
apply_filters( 'xmlsf_bwt_manual_submit_timeframe', 360 ); -
xmlsf_clear_settings
actiondo_action( 'xmlsf_clear_settings' ); -
xmlsf_defaults
filterapply_filters( 'xmlsf_defaults', $return, $key, $defaults ); -
xmlsf_disabled_post_types
filterapply_filters( 'xmlsf_disabled_post_types', $this->disabled_post_types ); -
xmlsf_disabled_taxonomies
filterapply_filters( 'xmlsf_disabled_taxonomies', $this->disabled_taxonomies ); -
xmlsf_excluded
filterapply_filters( 'xmlsf_excluded', get_post_meta( $post->ID, '_xmlsf_exclude', true ), $post->ID ); -
xmlsf_get_author_args
filterapply_filters( 'xmlsf_get_author_args', array( 'orderby' => 'post_count', 'order' => 'DESC', 'number' => '1000', 'fields' => array( 'ID', 'user_login', 'spam', 'deleted' ), 'has_published_posts' => true, ) ); -
apply_filters( 'xmlsf_gsc_manual_submit_news_timeframe', MINUTE_IN_SECONDS ); -
apply_filters( 'xmlsf_gsc_manual_submit_timeframe', 360 ); -
xmlsf_image_tags_inner
actiondo_action( 'xmlsf_image_tags_inner', 'post_type' ); -
xmlsf_index_url_args
filterapply_filters( 'xmlsf_index_url_args', \wp_parse_args( $args, array( 'type' => false, 'm' => false, 'w' => false, ) ) ); -
xmlsf_install
actiondo_action( 'xmlsf_install' ); -
xmlsf_news_add_settings
actiondo_action( 'xmlsf_news_add_settings', $active_tab ); -
xmlsf_news_entry_url
filterapply_filters( 'xmlsf_news_entry_url', get_permalink(), $post ); -
xmlsf_news_excluded
filterapply_filters( 'xmlsf_news_excluded', get_post_meta( $post->ID, '_xmlsf_news_exclude', true ), $post->ID ); -
xmlsf_news_help_tabs
actiondo_action( 'xmlsf_news_help_tabs', $screen, $active_tab ); -
xmlsf_news_hours_old
filterapply_filters( 'xmlsf_news_hours_old', 48 ); -
xmlsf_news_language
filterapply_filters( 'xmlsf_news_language', get_bloginfo( 'language' ), $post->ID, $post->post_type ); -
apply_filters( 'xmlsf_news_post_type_field_type', 1 === count( $news_post_type ) ? 'radio' : 'checkbox' ); -
xmlsf_news_publication_name
filterapply_filters( 'xmlsf_news_publication_name', ( defined( 'XMLSF_GOOGLE_NEWS_NAME' ) && XMLSF_GOOGLE_NEWS_NAME ? XMLSF_GOOGLE_NEWS_NAME : get_bloginfo( 'name' ) ), $post->ID, $post->post_type ); -
xmlsf_news_sclear_ettings
actiondo_action( 'xmlsf_news_sclear_ettings' ); -
xmlsf_news_settings_after
actiondo_action( 'xmlsf_news_settings_after', $active_tab ); -
xmlsf_news_settings_before
actiondo_action( 'xmlsf_news_settings_before', $active_tab ); -
xmlsf_news_tags_after
actiondo_action( 'xmlsf_news_tags_after', $post ); -
xmlsf_news_tags_inner
actiondo_action( 'xmlsf_news_tags_inner', $post ); -
xmlsf_news_title
filterapply_filters( 'xmlsf_news_title', get_the_title() ); -
xmlsf_news_url
actiondo_action( 'xmlsf_news_url', $post ); -
xmlsf_news_url_after
actiondo_action( 'xmlsf_news_url_after', $post ); -
xmlsf_post_types
filterapply_filters( 'xmlsf_post_types', $this->post_types ); -
do_action( 'xmlsf_posttype_archive_field_options', $obj, $archive ); -
xmlsf_settings_after
actiondo_action( 'xmlsf_settings_after', $active_tab ); -
xmlsf_settings_before
actiondo_action( 'xmlsf_settings_before', $active_tab ); -
xmlsf_sitemap_help_tabs
actiondo_action( 'xmlsf_sitemap_help_tabs', $screen, $active_tab ); -
xmlsf_sitemap_index
actiondo_action( 'xmlsf_sitemap_index' ); -
xmlsf_sitemap_index_after
actiondo_action( 'xmlsf_sitemap_index_after' ); -
xmlsf_sitemap_news_url
filterapply_filters( 'xmlsf_sitemap_news_url', \home_url( $basename ) ); -
xmlsf_skip_user
filterapply_filters( 'xmlsf_skip_user', false, $user ); -
xmlsf_stylesheet_url
filterapply_filters( 'xmlsf_stylesheet_url', $url ); -
xmlsf_upgrade
actiondo_action( 'xmlsf_upgrade', $db_version );
Generated from XML Sitemap & Google News's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: