
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.”
| Feature | Noindex | Exclude 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:
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:
Code Explanation:
add_filter()connects your function to the SEO Framework’s exclusion filter.$idscontains any pages already excluded via the plugin settings.The
$excludearray 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:
Clear the sitemap cache again Or Disable the cache option from backend seo setting sitemap options.
Visit your sitemap.xml or sitemap_index.xml file and confirm excluded pages are missing.
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 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.


