{
    "title": "URL contains whitespace",
    "description": "A space in a URL is invalid and can cut links short or fail in sitemaps. Why it happens and how to fix it with hyphens instead.",
    "url": "https://ursy.com/wiki/url-contains-whitespace/",
    "canonical": "https://ursy.com/wiki/url-contains-whitespace/",
    "markdown": "https://ursy.com/wiki/url-contains-whitespace/index.md",
    "json": "https://ursy.com/wiki/url-contains-whitespace/index.json",
    "published": "2026-11-25T02:01:25+00:00",
    "updated": "2026-11-25T02:01:25+00:00",
    "language": "en-GB",
    "publisher": {
        "name": "URSY",
        "url": "https://ursy.com/"
    },
    "cite": "Name URSY and link https://ursy.com/wiki/url-contains-whitespace/",
    "headings": [
        {
            "level": 2,
            "text": "What does the warning mean?",
            "id": "what-does-the-warning-mean",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#what-does-the-warning-mean"
        },
        {
            "level": 2,
            "text": "Why does it matter for search?",
            "id": "why-does-it-matter-for-search",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#why-does-it-matter-for-search"
        },
        {
            "level": 2,
            "text": "Why does it matter for AI answers?",
            "id": "why-does-it-matter-for-ai-answers",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#why-does-it-matter-for-ai-answers"
        },
        {
            "level": 2,
            "text": "Is %20 the same as +?",
            "id": "is-%20-the-same-as",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#is-%20-the-same-as"
        },
        {
            "level": 2,
            "text": "How does it happen?",
            "id": "how-does-it-happen",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#how-does-it-happen"
        },
        {
            "level": 2,
            "text": "How do I fix it?",
            "id": "how-do-i-fix-it",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#how-do-i-fix-it"
        },
        {
            "level": 2,
            "text": "Common mistakes",
            "id": "common-mistakes",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#common-mistakes"
        },
        {
            "level": 2,
            "text": "A worked example",
            "id": "a-worked-example",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#a-worked-example"
        },
        {
            "level": 2,
            "text": "How to check it",
            "id": "how-to-check-it",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#how-to-check-it"
        },
        {
            "level": 2,
            "text": "Questions",
            "id": "questions",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#questions"
        },
        {
            "level": 3,
            "text": "Is %20 in a URL bad for SEO?",
            "id": "is-%20-in-a-url-bad-for-seo",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#is-%20-in-a-url-bad-for-seo"
        },
        {
            "level": 3,
            "text": "Why do some sites show + for spaces?",
            "id": "why-do-some-sites-show-for-spaces",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#why-do-some-sites-show-for-spaces"
        },
        {
            "level": 3,
            "text": "Do I need to fix PDFs and images too?",
            "id": "do-i-need-to-fix-pdfs-and-images-too",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#do-i-need-to-fix-pdfs-and-images-too"
        },
        {
            "level": 2,
            "text": "Related words",
            "id": "related-words",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#related-words"
        },
        {
            "level": 2,
            "text": "Sources",
            "id": "sources",
            "url": "https://ursy.com/wiki/url-contains-whitespace/#sources"
        }
    ],
    "links": [
        {
            "text": "URL",
            "url": "https://ursy.com/wiki/url/",
            "internal": true
        },
        {
            "text": "RFC 3986",
            "url": "https://www.rfc-editor.org/rfc/rfc3986",
            "internal": false
        },
        {
            "text": "query",
            "url": "https://ursy.com/wiki/url-parameter/",
            "internal": true
        },
        {
            "text": "Google",
            "url": "https://ursy.com/wiki/google/",
            "internal": true
        },
        {
            "text": "URL structure best practices",
            "url": "https://developers.google.com/search/docs/crawling-indexing/url-structure",
            "internal": false
        },
        {
            "text": "Search Console sitemaps report",
            "url": "https://support.google.com/webmasters/answer/7451001",
            "internal": false
        },
        {
            "text": "XML sitemap",
            "url": "https://ursy.com/wiki/xml-sitemap/",
            "internal": true
        },
        {
            "text": "404",
            "url": "https://ursy.com/wiki/404-and-410/",
            "internal": true
        },
        {
            "text": "duplicate content",
            "url": "https://ursy.com/wiki/duplicate-content/",
            "internal": true
        },
        {
            "text": "AI crawlers",
            "url": "https://ursy.com/wiki/ai-crawler/",
            "internal": true
        },
        {
            "text": "AI crawlability",
            "url": "https://ursy.com/wiki/ai-crawlability/",
            "internal": true
        },
        {
            "text": "citation",
            "url": "https://ursy.com/wiki/citation/",
            "internal": true
        },
        {
            "text": "encodeURIComponent",
            "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent",
            "internal": false
        },
        {
            "text": "slug",
            "url": "https://ursy.com/wiki/url-slug/",
            "internal": true
        },
        {
            "text": "redirect",
            "url": "https://ursy.com/wiki/redirect/",
            "internal": true
        },
        {
            "text": "internal links to redirected URLs",
            "url": "https://ursy.com/wiki/internal-links-to-redirected-urls/",
            "internal": true
        },
        {
            "text": "search query",
            "url": "https://ursy.com/wiki/search-query/",
            "internal": true
        },
        {
            "text": "canonical tag",
            "url": "https://ursy.com/wiki/canonical-tag/",
            "internal": true
        },
        {
            "text": "shopping feed",
            "url": "https://ursy.com/wiki/shopping-feed/",
            "internal": true
        },
        {
            "text": "SEO audit",
            "url": "https://ursy.com/seo-audit/",
            "internal": true
        },
        {
            "text": "broken link checker",
            "url": "https://ursy.com/broken-link-checker/",
            "internal": true
        },
        {
            "text": "sitemap checker",
            "url": "https://ursy.com/sitemap-checker/",
            "internal": true
        },
        {
            "text": "URL parser",
            "url": "https://ursy.com/webmaster-tools/url-parser/",
            "internal": true
        },
        {
            "text": "URL encoder and decoder",
            "url": "https://ursy.com/webmaster-tools/url-encoder-decoder/",
            "internal": true
        },
        {
            "text": "whitespace cleaner",
            "url": "https://ursy.com/webmaster-tools/whitespace-cleaner/",
            "internal": true
        },
        {
            "text": "URL slug optimiser",
            "url": "https://ursy.com/webmaster-tools/url-slug-optimiser/",
            "internal": true
        },
        {
            "text": "redirect checker",
            "url": "https://ursy.com/redirect-checker/",
            "internal": true
        },
        {
            "text": "bot",
            "url": "https://ursy.com/wiki/bot-web-robot/",
            "internal": true
        },
        {
            "text": "image SEO",
            "url": "https://ursy.com/wiki/image-seo/",
            "internal": true
        },
        {
            "text": "SEO-friendly URL",
            "url": "https://ursy.com/wiki/seo-friendly-url/",
            "internal": true
        },
        {
            "text": "Broken link",
            "url": "https://ursy.com/wiki/broken-link/",
            "internal": true
        },
        {
            "text": "Permalink",
            "url": "https://ursy.com/wiki/permalink/",
            "internal": true
        }
    ],
    "words": 1003,
    "text": "“URL contains whitespace” is an audit warning that a link or listed address has a space, tab or line break in it, such as /summer sale/, instead of the encoded form %20 or, better, a hyphen. A space is not a valid character in a raw web address. Browsers often repair it quietly, but sitemaps, feeds, emails and many crawlers do not, so the link can break or point to the wrong page. What does the warning mean? A URL is built from a small set of allowed characters. The space is not one of them. RFC 3986, the standard for web addresses, shows that a space is written as %20 when encoded, with the example Laguna%20Beach. Its appendix on finding addresses inside text says spaces, tabs and line breaks may be added only to wrap a long address across lines, and must be ignored when the address is read back. In short, whitespace is never part of a clean URL. The warning usually covers 3 cases: A space inside the path or query, like /product/blue mug. A space before or after the address in the href, like href=\" /contact/\". A line break or tab pasted into the middle of a link. Why does it matter for search? Google’s URL structure best practices say reserved characters must be percent-encoded, and recommend hyphens to separate words. Google’s help page on the Search Console sitemaps report lists “Invalid URL” as an error and tells you to check for unsupported characters, spaces or quotes. So an XML sitemap with a raw space can fail for that address. Spaces also cause quieter harm: Cut-off links. Many programs treat a space as the end of an address. /summer sale/ becomes /summer, which may be a 404. Several forms of one page. The same page can be linked as raw space, %20 and +. Tools may count 3 addresses, which looks like duplicate content. Ugly shares. An address full of %20 is hard to read and to say out loud. Why does it matter for AI answers? AI crawlers and agents fetch pages with standard code. They are strict: a raw space can make the request fail or cut the address short. When an assistant quotes your page, it copies the link as it found it. If that link has a space, the person who clicks it may land on an error. A tidy address supports AI crawlability and keeps the citation working. Is %20 the same as +? Not always. In a path, a space is %20. In form data sent as application/x-www-form-urlencoded, a space is written as +. MDN’s page on encodeURIComponent explains that the function turns a space into %20, and that for form encoding you swap %20 for + as an extra step. A + in a path is just a plus sign. Mixing the two is a common source of broken search and filter links. How does it happen? A file is uploaded with a space in its name, such as Price List 2026.pdf, and linked as it is. A page title is used as the slug without a hyphen rule. A link is copied from a document or email and picks up a leading space or a line break. A site search or filter writes the search words into the address without encoding. How do I fix it? Use hyphens in new slugs. /summer-sale/, not /summer sale/ and not /summer_sale/. Google recommends hyphens over underscores. Rename files with hyphens before you upload them. Trim the href. Remove spaces at the start or end of every link in menus, templates and posts. Redirect old addresses. If a live page had a space, add a permanent redirect from the %20 form to the new hyphen form, then update internal links. See internal links to redirected URLs. Encode what you keep. If a space must stay, for example in a search query, make sure the code encodes it. Common mistakes Trusting the browser. It may fix the link for you, so the problem stays hidden until a crawler, a feed or an email client meets it. Fixing the page but not the sitemap. Check every place the address is listed, including the canonical tag and your shopping feed. Encoding twice. %20 encoded again becomes %2520, which points to a different address. A worked example A UK florist links a price list as /files/Wedding Prices.pdf from 12 pages. The browser opens it, so nobody notices. An audit flags the space. The sitemap plugin also lists it raw, and the Search Console sitemaps report shows an “Invalid URL” error. The florist renames the file to /files/wedding-prices.pdf, sets a 301 from the old %20 address, and updates the 12 links. The next audit shows no whitespace warnings, and a fresh sitemap passes. How to check it Run our free SEO audit or broken link checker to find links with spaces or that break. Run our free sitemap checker to spot invalid addresses in your sitemap. Paste one address into our free URL parser or URL encoder and decoder to see exactly where the space sits. Clean a list of links with our free whitespace cleaner, and make new slugs with the URL slug optimiser. Test the old address in our free redirect checker after the fix. Questions Is %20 in a URL bad for SEO? It works, but it is not tidy. Hyphens are easier to read and share, and Google recommends them for separating words. Why do some sites show + for spaces? That is form encoding, used in search and filter queries. It belongs in the query part only. Do I need to fix PDFs and images too? Yes. Any file a person or bot can follow is an address, and the same rules apply. See image SEO. Related words URL slug SEO-friendly URL Broken link URL parameter Permalink Sources RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, checked 25 November 2026 Google Search Central: URL structure best practices for Google Search, checked 25 November 2026 Google Search Console Help: Manage your sitemaps using the Sitemaps report, checked 25 November 2026 MDN: encodeURIComponent(), checked 25 November 2026 Updated 25 November 2026 by URSY.",
    "source": "https://ursy.com/wiki/url-contains-whitespace/"
}