CONTENTS

    How to Modify or Delete Links in a Sitemap (WordPress, Shopify, Wix, and Custom XML)

    avatar
    Tony Yan
    ·November 4, 2025
    ·8 min read
    Illustration
    Image Source: statics.mylandingpages.co

    If you need to remove outdated URLs from search results or fix incorrect entries in your sitemap, this guide shows exactly how to modify or delete links across WordPress, Shopify, Wix, and custom XML setups—plus how to verify changes in Google Search Console.

    Before we start, one crucial principle: a sitemap is a crawl hint, not a command. Removing a URL from your sitemap does not remove it from Google’s index. You must pair sitemap changes with the right indexing signal (redirect, 404/410, noindex, or canonical) to get the result you want. Google explains the role of sitemaps in its guidance on what a sitemap is and how it helps discovery.

    Difficulty: Easy to moderate, depending on your CMS. Time: 10–30 minutes for most cases.


    Step 1: Decide Your Intent and Choose the Right Signal

    Use this quick decision map to pick the correct action. You’ll apply the signal first, then update/confirm the sitemap.

    • The content moved to a new URL (keep rankings/users):
      • Do: 301 redirect old URL to the new canonical destination.
      • Then: Ensure the new URL (not the old) appears in the sitemap.
    • The content should no longer exist and shouldn’t be indexed:
      • Do: Return 404 (Not Found) or 410 (Gone). A 410 can expedite removal.
      • Then: Remove it from the sitemap.
    • The content should exist but not be indexed (e.g., thank-you pages, internal-only docs):
      • Do: Add meta robots noindex (and keep it crawlable).
      • Then: Remove it from the sitemap (don’t list non-indexable pages).
    • Duplicate or alternate version exists elsewhere:
      • Do: Use a canonical tag pointing to the preferred URL; consider removing the duplicate from the sitemap.

    Important pitfall: Don’t block a page in robots.txt if you need Google to see a noindex tag—the block prevents crawling and Google can’t see the noindex. See Google’s primer on robots.txt behavior for why crawl access matters.

    For official, permanent removal methods and the temporary Removals tool, see Google’s documentation on removing information from Google (2025).


    Step 2: Update or Remove URLs in Your CMS or XML Sitemap

    Below are platform-specific instructions. After you apply the indexing signal (redirect, 404/410, noindex), make sure your sitemap reflects only canonical, indexable, 200-OK URLs. Google’s limits and required tags for sitemaps are documented in its guide to building and submitting sitemaps (maximum 50,000 URLs per file, 50 MB uncompressed, XML schema, etc.).

    WordPress (Core sitemap, Yoast SEO, Rank Math)

    WordPress 5.5+ exposes a dynamic sitemap index at /wp-sitemap.xml. By default, it lists public post types and taxonomies. To remove or modify URLs, follow one of these approaches.

    1. If you use Yoast SEO
    • Remove a URL from indexing:
      • Open the post/page, go to the Yoast SEO panel, set meta robots to noindex (if the page should exist but not be indexed), or unpublish/delete if the page should be removed.
      • If content moved, add a 301 redirect to the new canonical URL.
    • Ensure the sitemap updates:
      • Yoast automatically excludes noindexed content from its XML sitemaps. See Yoast’s guide on excluding content from the XML sitemap.
      • Save your changes and, if you use caching/CDN, clear caches. The plugin’s sitemap should reflect the change shortly.
    1. If you use Rank Math
    • Remove a URL from indexing:
      • In the post/page, use Rank Math’s Advanced tab to set noindex, or delete the post if it should return 404/410.
      • For moves, configure a 301 redirect to the new URL.
    • Ensure the sitemap updates:
      • Rank Math excludes noindexed content from its sitemap. Their docs cover how to exclude posts from the sitemap.
      • Save settings, then clear caches/CDN if needed.
    1. If you rely on the WordPress Core /wp-sitemap.xml and need granular control
    • Core doesn’t auto-exclude noindex pages by default. Developers can filter which post types/taxonomies appear and even adjust queries:
    • For non-developers needing easier control, consider an SEO plugin (Yoast or Rank Math) to manage noindex and automatic sitemap exclusion without custom code.

    Micro-checks

    • Visit /wp-sitemap.xml (or the plugin’s sitemap URL) to confirm the URL has been removed or updated.
    • Verify the removed URL returns 404/410 or redirects as intended.

    Common pitfalls

    • Leaving redirected or 404 URLs in the sitemap. Only 200-OK canonical URLs belong there.
    • Forgetting to clear caches/CDN; you may see a stale sitemap.

    Shopify (Auto-generated sitemap)

    Shopify automatically generates a sitemap index at /sitemap.xml that includes child files for products, collections, pages, and blog posts. You can’t manually edit the XML, so you control inclusion indirectly through content status and redirects.

    • To delete or deindex:
      • If content is gone for good, delete it so the old URL returns 404/410 (Shopify typically returns 404). If it moved, create a 301 redirect to the new URL.
      • Optional: add meta robots noindex for pages that should exist but not be indexed (theme edit or via an SEO app), and avoid listing such pages in navigation.
    • Verify and submit:

    Micro-checks

    • After deleting or redirecting, inspect the old URL in GSC’s URL Inspection tool to confirm live status (404/410 or 301).
    • Check your /sitemap.xml; changes may take time to propagate.

    Common pitfalls

    • Expecting immediate removal from the sitemap—Shopify updates automatically but not always instantly.
    • Relying on robots.txt to deindex; use 404/410, redirects, or noindex instead.

    Wix (Auto-generated sitemap, SEO tools)

    Wix auto-generates sitemap.xml and updates it as you publish changes. You can control indexability and redirects via Wix SEO settings and tools.

    • To remove or deindex a page:
      • If the page should exist but not be indexed, open the page’s SEO settings and toggle indexing off (adds noindex). If it should be removed, delete it so it returns 404/410, or redirect it if it moved.
      • Wix provides learning resources on sitemap.xml behavior and related SEO controls.
    • Publish and verify:
      • Publish the site changes. Then check sitemap.xml and verify in Google Search Console via URL Inspection and the Sitemaps report.

    Micro-checks

    • Confirm the page’s SEO toggle reflects noindex when intended.
    • After publishing, re-check sitemap.xml for the entry’s removal or update.

    Common pitfalls

    • Forgetting to Publish after SEO changes, so the sitemap doesn’t refresh.
    • Keeping noindexed pages listed in the sitemap—remove them.

    Custom XML Sitemaps (Manual Editing)

    If you maintain your own sitemap.xml files, edit them carefully and validate the XML before deploying.

    1. Remove a single URL
    • Find the relevant block and delete it. Example:
    <url>
      <loc>https://example.com/old-page</loc>
      <lastmod>2024-08-10</lastmod>
    </url>
    
    1. Modify a URL
    • Update the value to the new canonical URL and adjust to the current date. Ensure the new URL returns 200 and is indexable.
    1. Validate and deploy
    • Ensure the file is valid XML, UTF-8 encoded, served with content-type application/xml, returns HTTP 200, and respects size/URL limits. Google outlines these details in build and submit sitemaps.
    • If you split large sitemaps, list them in a sitemap index file ( with entries). Keep accurate.
    1. Resubmit in Google Search Console
    • Upload the revised file(s) to your site.
    • In GSC, go to Sitemaps, submit the sitemap URL, and confirm processing succeeded.

    Micro-checks

    • Open the sitemap URL in a browser to confirm the URL has been removed/updated.
    • Use GSC’s URL Inspection on changed URLs to confirm live status, canonical, and meta robots.

    Common pitfalls

    • Leaving redirects or 404/410 URLs in the sitemap.
    • Syntax errors (e.g., missing closing tags) causing “Couldn’t fetch” or parsing errors in GSC.

    Step 3: Verify Your Changes in Google Search Console

    • Resubmit and monitor the sitemap
      • Open Search Console > Sitemaps. Submit or resubmit your main sitemap (or sitemap index) and check the “Last read” timestamp and status.
    • Inspect affected URLs
      • Use the URL Inspection tool on the old and new URLs to see the live HTTP status, indexing status, canonical, and whether robots/noindex are detected.
    • For urgent takedowns
      • Use the Removals tool to temporarily hide URLs while you keep permanent signals in place (redirects, 404/410, noindex). Google documents this in its page on removing information (note: removals are temporary unless backed by permanent signals).

    Step 4: Troubleshooting Playbook

    Symptoms and fixes you’ll likely encounter—and how to resolve them quickly.

    • “Submitted URL not found (404)” in Sitemaps report

      • Intended deletion: Keep the 404/410 and remove the URL from the sitemap.
      • Unintended: Restore the page or fix the URL so it returns 200.
    • “Submitted URL seems to be a Soft 404”

      • Ensure the page has unique, substantial content and returns 200, or intentionally return a real 404/410 if it’s gone.
    • “Submitted URL has a redirect”

      • Use only final destination URLs in the sitemap. Update the sitemap to the canonical 200-OK URL and fix redirect chains/loops.
    • “Submitted URL blocked by robots.txt”

      • Decide intent: If you need deindexing via noindex, allow crawling so Google can see the tag; or remove the URL from the sitemap if it’s not meant to be indexed. Google’s robots.txt introduction explains why blocked pages can remain indexed.
    • “Submitted URL marked ‘noindex’”

      • Align with intent: Either remove noindex (if it should index) or remove it from the sitemap (if it shouldn’t index).
    • “Couldn’t fetch” or general HTTP errors on the sitemap

      • Ensure the sitemap URL returns 200, content-type is application/xml, the file is reachable (no auth/cookie walls), and the XML is valid.
    • CMS caches/CDNs show stale sitemaps

      • Purge plugin caches and CDN edge caches, then re-check.

    Best Practices That Prevent Sitemap Headaches

    • Include only canonical, indexable URLs in sitemaps (200 OK, not blocked by robots.txt, not noindex, not redirects).
    • Use 301 for permanent moves; use 404/410 for removals. A 410 can speed up deindexing relative to a 404, per industry practice and Google guidance on removals.
    • Keep accurate and useful. Don’t spoof; reserve updates for real content changes.
    • Break up large sites into multiple sitemaps and a sitemap index; respect 50,000-URL and 50 MB limits as explained in build and submit sitemaps.
    • Reference your sitemap in robots.txt with a Sitemap: directive to aid discovery.

    Quick Reference: What Each CMS Lets You Do

    • WordPress
      • Easiest control with plugins (Yoast/Rank Math auto-exclude noindex). Developers can filter core sitemap contents via hooks like wp_sitemaps_post_types.
    • Shopify
      • Sitemap is auto-generated and not manually edited. Control via redirects, deletions, and optional noindex. Verify via GSC as outlined in Shopify’s GSC setup guide.
    • Wix
      • Sitemap auto-updates. Use page-level index toggles, redirects, and SEO tools. Learn more with Wix’s overview of sitemap.xml.
    • Custom XML
      • Full control; remember to validate XML, respect limits, and resubmit in GSC.

    Appendix: Minimal XML Examples

    Sitemap (urlset) with one URL

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      <url>
        <loc>https://example.com/page</loc>
        <lastmod>2025-11-04</lastmod>
      </url>
    </urlset>
    

    Sitemap index referencing child sitemaps

    <?xml version="1.0" encoding="UTF-8"?>
    <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      <sitemap>
        <loc>https://example.com/sitemap-posts.xml</loc>
        <lastmod>2025-11-04</lastmod>
      </sitemap>
      <sitemap>
        <loc>https://example.com/sitemap-pages.xml</loc>
        <lastmod>2025-11-04</lastmod>
      </sitemap>
    </sitemapindex>
    

    Credible Resources for Further Reading

    Accelerate Your Blog's SEO with QuickCreator AI Blog Writer