Zeeshan Web Expert
  • Home
  • About Me
  • Services
    • Design & Dev
    • Theme Development
    • Plugin Development
    • Speed Optimization
    • Bug Fixing
    • Security & Maintenance
    • WooCommerce Services
    • Themosis Development
  • Maintenance Plans
    • Locations
      • WordPress Maintenance Services in the UK
      • WordPress Maintenance Services in the USA
      • WordPress Maintenance Services in Australia
      • WordPress Maintenance Services in the UAE
      • WordPress Maintenance Services in Pakistan
  • Portfolio
  • Blog
  • Contact
LET'S TALK

How to Exclude Specific Pages from Your SEO Framework Plugin: A Complete Step-by-Step Guide

  • Zeeshan Mehmood
  • 4 min read
  • No Comments
  • Wordpress Wordpress issues
  • clear sitemap cache SEO Framework exclude pages from indexing WordPress exclude pages SEO Framework exclude thank you page from Google hide login page from search engines remove page from sitemap WordPress SEO Framework PHP hook example SEO Framework sitemap exclude The SEO Framework noindex settings WordPress SEO page exclusion
  • Home
  • Wordpress issues
  • How to Exclude Specific Pages ...
How to Exclude Specific Pages from Your SEO Framework Plugin: A Complete Step-by-Step Guide
Table of contents
  1. Introduction: Why You Might Want to Hide Pages from Search Engines
  2.  Understanding Page Exclusion vs. Noindex
  3. Common Pages You Should Exclude
  4.  Clearing the Sitemap Cache
    1. Step 1: Go to SEO → Sitemap Settings
    2. Step 2: Click to Clear
    3. Step 3: Verify the Sitemap
  5. Excluding Pages via PHP Hook (Advanced Method)
  6. Testing and Verifying Your Changes
  7. Section 7: When and Why Exclusion Helps SEO
  8. Conclusion: Keep Your Sitemap Lean and Purposeful

Introduction: Why You Might Want to Hide Pages from Search Engines

Not every page on your website deserves to appear in Google’s search results. Some pages serve internal or functional purposes  such as thank-you pages, login screens, or staging pages  that don’t provide value to search users. If search engines index these pages, it can hurt your SEO performance and create confusing user experiences.

Luckily, most SEO framework plugins allow you to easily control which pages are visible to search engines. In this article, you’ll learn how to exclude specific pages both through your plugin settings and using a custom PHP hook. You’ll also discover why clearing your sitemap cache is an essential final step.

 Understanding Page Exclusion vs. Noindex

Before applying exclusions, it’s important to understand the difference between “excluding” a page and marking it as “noindex.”

FeatureNoindexExclude Page
Appears in sitemap✅ Yes❌ No
Crawled by search engines✅ Yes❌ No
Shown in search results❌ No❌ No

In short:

  • Noindex tells search engines not to show the page in results but still allows crawling.

  • Exclusion completely removes the page from both your sitemap and crawling consideration — a cleaner and more efficient method for irrelevant or private content.

Common Pages You Should Exclude

Here are typical examples of pages you should exclude for better SEO and privacy:

  • Thank-you pages – Shown after form submissions; not meant for search visitors

  • Staging or test pages – Temporary or duplicate versions of live content

  • Login and account pages – Contain sensitive or restricted information

  • Checkout or payment pages – Transactional and irrelevant to organic users

  • Internal search results – Automatically generated, poor for SEO

  • Privacy or confirmation pages – Useful internally but unnecessary for indexing

💡 Pro Tip: Always exclude pages that don’t contribute to your keyword or ranking strategy.

 Clearing the Sitemap Cache

Clearing the sitemap cache ensures your changes are recognized immediately by both your plugin and search engines.

Step 1: Go to SEO → Sitemap Settings

You’ll see an option like “Clear Cache” or “Regenerate Sitemap.”

Step 2: Click to Clear

After clearing, your sitemap will refresh and rebuild without the excluded pages.

Step 3: Verify the Sitemap

Visit your sitemap URL:

yourwebsite.com/sitemap.xml

Check to ensure the excluded page URLs are no longer listed.

Excluding Pages via PHP Hook (Advanced Method)

If you prefer more control  or want to automate exclusions  you can exclude pages programmatically using a PHP hook.

Here’s an example:

<?php
/**
* Exclude specific pages from The SEO Framework sitemap.
* Add this code to your theme's functions.php file or a custom plugin.
*/
add_filter( ‘the_seo_framework_sitemap_exclude_ids’, function( $ids ) {// Add the page IDs you want to exclude
$exclude = array( 45, 78, 102 );// Merge with existing exclusions
return array_merge( $ids, $exclude );

});

Code Explanation:

  • add_filter() connects your function to the SEO Framework’s exclusion filter.

  • $ids contains any pages already excluded via the plugin settings.

  • The $exclude array lists your additional page IDs.

  • array_merge() ensures your pages are combined with any existing exclusions.

💡 Where to add the code:

  • Inside your theme’s functions.php file, or

  • Create a small custom plugin for better portability (recommended for developers).

Testing and Verifying Your Changes

After adding exclusions:

  1. Clear the sitemap cache again Or Disable the cache option from backend seo setting sitemap options.

  2. Visit your sitemap.xml or sitemap_index.xml file and confirm excluded pages are missing.

  3. Use Google Search Console to re-submit your sitemap for faster indexing updates.

Section 7: When and Why Exclusion Helps SEO

Here are some real-world cases:

  • Cleaner crawl budget: Search engines spend more time indexing your important content.

  • Better user experience: Prevents users from landing on irrelevant pages.

  • Improved security: Keeps login or backend pages private.

  • Accurate analytics: Eliminates traffic data from unwanted URLs.

By strategically excluding pages, you help search engines focus on what truly matters for your site’s visibility and performance.

Conclusion: Keep Your Sitemap Lean and Purposeful

Excluding specific pages from your SEO framework plugin isn’t just a technical step it’s part of a smart SEO strategy. Whether you do it through the plugin’s backend settings or a simple PHP hook, remember to clear your sitemap cache afterward to make your changes effective.

A clean sitemap = better crawl efficiency, stronger SEO performance, and a more professional online presence.

Zeeshan Mehmood
Zeeshan Mehmood

Zeeshan is a seasoned web developer with over 8+ years of experience, specializing in WordPress, Themosis, and Laravel. customized web solutions. Through his website, zeeshanwebexpert.com, Zeeshan offers professional web services, ensuring long-term solutions for clients.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

multilingual wordpress seo - A digital world map with WordPress icons representing global website localization and growth.
Multilingual WordPress SEO: How to Reach a
  • March 29, 2026
  • 11 min read
voice search seo wordpress - A professional speaking into a smartphone while managing a WordPress site on a laptop screen.
Voice Search SEO WordPress: The Complete Optimization
  • March 28, 2026
  • 10 min read
wordpress internal linking tips - A web developer mapping a website architecture on a clear glass board in a modern office.
WordPress Internal Linking Tips: Strategies That Work
  • March 27, 2026
  • 11 min read
Need Expert WordPress Support?

Professional WordPress care tailored to your website’s needs.

Let's Build Together
Zeeshan Web Expert

© 2025. All rights reserved by zeeshanwebexpert. Privacy Policy | Terms and Conditions

Step 1 of 5

20%
Name(Required)