A quick overview of all available action and filter hooks in XML Sitemap & Google News.
Action hooks
Hook name | Context | Description |
---|---|---|
xmlsf_ping | Admin, XML Sitemap, Google News | Fires when a search engine has been pinged. Carries four arguments: search engine (google|yandex| ), sitemap name, full ping URL, ping response code. |
xmlsf_urlset | XML Sitemap | Fired inside each sitemap’s <urlset> tag. Can be used to echo additional XML namespaces. Passes parameter home|post_type|taxonomy|custom to allow identification of the current sitemap. |
xmlsf_url | XML Sitemap | Fired inside the XML Sitemap loop at the start of each sitemap <url> tag. Passes parameter sitemap type (currently only ‘post_type’) to allow identification of the current sitemap. |
xmlsf_image_tags_inner | XML Sitemap | Fired inside the XML Sitemap loop just before each closing </image:image> is generated. Can be used to echo custom <image:image> tags or trigger another action in the background. |
xmlsf_tags_after | XML Sitemap | Fired inside the XML Sitemap loop at the end of the tags, just before each closing </url> is generated. Can be used to echo custom tags or trigger another action in the background. Passes parameter home|post_type|taxonomy|custom to allow identification of the current sitemap. |
xmlsf_url_after | XML Sitemap | Fired inside the XML Sitemap loop after each <url> node. Can be used to append alternative URL or trigger another action in the background. Passes parameter home|post_type|taxonomy|custom to allow identification of the current sitemap. |
xmlsf_news_urlset | Google News | Fired inside the Google News Sitemap urlset tag. Can be used to echo additional XML namespaces. |
xmlsf_news_tags_inner | Google News | Fired inside the Google News Sitemap loop at the end of the news tags, just before each closing </news:news> is generated. Can be used to echo custom news:news tags or trigger another action in the background. |
xmlsf_news_tags_after | Google News | Fired inside the Google News Sitemap loop at the end of the news tags, just before each closing </url> is generated. Can be used to echo custom news tags or trigger another action in the background. |
xmlsf_news_url_after | Google News | Fired inside the Google News Sitemap loop after each news url node. Can be used to append alternative url or trigger another action in the background. |
xmlsf_news_settings_before | Admin, Google News | Fired before the Google News Sitemap settings form. |
xmlsf_news_settings_after | Admin, Google News | Fired after the Google News Sitemap settings form. |
Filter hooks
Hook name | Context | Description |
---|---|---|
xmlsf_defaults | Admin, XML Sitemap, Google News | Filters the default array values for different option groups. |
xmlsf_request | XML Sitemap | Filters request when an XML sitemap request is found, can be used for plugin compatibility. |
xmlsf_news_request | Google News | Filters request when a news sitemap request is found can be used for plugin compatibility. |
xmlsf_allowed_domain | XML Sitemap | Filters the response when checking the URL against allowed domains. Passes variable $url ; must return true or false. |
xmlsf_index_url_args | XML Sitemap Index | Filters the index URL arguments array. |
xmlsf_excluded | XML Sitemap | Filters the response when checking the post for exclusion flags in XML Sitemap context. Passes the post exclusion flag and $post_id ; must return true or false. |
xmlsf_news_excluded | Google News | Filters the response when checking the post for exclusion flags in Google News sitemap context. Passes variable $post_id ; must return true or false. |
xmlsf_news_keywords | Google News | Filters the news keywords array. |
xmlsf_news_stock_tickers | Google News | Filters the news stock tickers array. |
xmlsf_disabled_taxonomies | XML Sitemap | Filters the taxonomies that should be unavailable for sitemaps. Passes an array of taxonomies to exclude; must return an array. |
the_title_xmlsitemap | XML Sitemap | Filters the Image title and caption tags. |
xmlsf_news_publication_name | Google News | Filters the Google News publication name. |
xmlsf_news_title | Google News | Filters the Google News post title. |
xmlsf_root_data | XML Sitemap | Filters the root data URLs (with priority and lastmod ) array. |
xmlsf_custom_urls | XML Sitemap | Filters the custom URLs array. |
xmlsf_custom_sitemaps | XML Sitemap Index | Filters the custom sitemaps array. |
xmlsf_news_language | Google News | Filters the post language tag used in the news sitemap. Passes variable $post_id ; must return a 2 or 3 letter ISO 639 language code with the exception of zh-cn and zh-tw . |
xmlsf_post_types | XML Sitemap Index | Filters the post types array for the XML sitemaps index. |
xmlsf_post_priority | XML Sitemap | Filters a post priority value. Passes variables $priority and $post->ID . Must return a float value between 0.1 and 1.0 |
xmlsf_term_priority | XML Sitemap | Filters a taxonomy term priority value. Passes variables $priority and $term->slug . Must return a float value between 0.1 and 1.0 |
xmlsf_author_post_types | XML Sitemap | Filters the post type that is used to get author archive lastmod date. Passes variable array('post') . Must return an array of one or more (public) post type slugs. |
xmlsf_news_post_types | Admin, Google News | Filters the post types array for the Google News sitemap settings page. |
xmlsf_stylesheet_url | XML Sitemap, Google News | Filters the sitemaps style sheet URL. |