“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, likehref=" /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,
%20and+. Tools may count 3 addresses, which looks like duplicate content. - Ugly shares. An address full of
%20is 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
%20form 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.
%20encoded 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 #
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.
Cite this page: URL contains whitespace. URSY. Updated 25 November 2026. https://ursy.com/wiki/url-contains-whitespace/ · Section links
Tools for this
- LiveAI Readiness Checkeris your site ready for ChatGPT, Gemini, Claude? Score + fixesRun the check →
- LiveAI Bot Checkerwhich AI bots your robots.txt lets inRun the check →
- LiveRobots.txt Checker + Generatortest any address against your rules, or write new onesRun the check →
- LiveSchema Markup CheckerRun the check →