The request
“We've had several templates in use and have leftover old code. Search engines are indexing pages that shouldn't be indexed. We need the robots rules and the old code cleaned up.”
Crawl clutter from years of theme changes.
The approach
We removed the leftover code, set robots rules to exclude the pages that shouldn't be indexed, and confirmed the sitemap only contained the pages that should.
What we shipped
Leftover theme code removed
Robots rules updated
Sitemap cleaned
Verified in Search Console