|
/ Documentation /Developers Documentation/ Customize XML Sitemap Top Bar with surerank_sitemap_top_bar_data

Customize XML Sitemap Top Bar with surerank_sitemap_top_bar_data

Hook: surerank_sitemap_top_bar_data

Description: This filter allows you to white-label the XML sitemap top bar content and styling in SureRank. You can change the title, description text, branding link labels, and top bar colors without affecting sitemap table generation.

Source: inc/sitemap/stylesheet.php

Usage: Use this filter to customize only the top bar in sitemap index and child sitemap views. The sitemap table structure and sitemap generation pipeline remain unchanged.

Example:

/**
 * White-label SureRank sitemap top bar.
 */
add_filter( 'surerank_sitemap_top_bar_data', function ( $data ) {
	$data['title']              = 'Acme SEO Sitemap';
	$data['description_prefix'] = 'This XML Sitemap is maintained by';
	$data['plugin_label']       = 'Acme SEO Team';
	$data['plugin_url']         = 'https://example.com/seo';
	$data['description_suffix'] = 'to help search engines discover content faster.';
	$data['learn_more_label']   = 'Read XML Sitemap protocol docs';
	$data['learn_more_url']     = 'https://www.sitemaps.org/protocol.html';
	$data['background_color']   = '#0B1F3A';
	$data['heading_color']      = '#FFFFFF';
	$data['description_color']  = '#D1D5DB';

	return $data;
} );

Available keys:

  • title
  • description_prefix
  • plugin_label
  • plugin_url
  • description_suffix
  • learn_more_label
  • learn_more_url
  • background_color
  • heading_color
  • description_color

Notes:

  • Invalid colors fall back to SureRank defaults.
  • Invalid URLs fall back to SureRank defaults.
  • This filter does not change sitemap rows, columns, URL count, or XML generation logic.

You can add the example code to your child theme functions.php file or use a plugin like Code Snippets to safely insert custom code. Using a code snippet plugin is recommended for easier management and to keep the customization active even when changing themes.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top