4

When I pass my URL to the Google Rich Results Test or in Google Search Console, the URL automatically changes. Here's an example:

https://example.com/blog/Jak%20zainstalować%20WordPress%20na%20swoim%20komputerze%20na%20localhost%3F/

In Google this automatically changes it to:

https://example.com/blog/Jak zainstalować WordPress na swoim komputerze na localhost

(in the second URL the encoded "?" is deleted)

Is there any way to have my page indexed without deleting "?" from the URL, since Google Search Console can't reach my site because of that change?

This is actually continuation of this thread on Google's Search Console Help.

1 Answer 1

4

The question mark is part of the param, not the URL. There is an answer here Which special characters are safe to use in url?

Quoted from Uniform Resource Identifiers (URI): Generic Syntax

2.2. Reserved Characters Many URI include components consisting of or delimited by, certain special characters. These characters are called "reserved", since their usage within the URI component is limited to their reserved purpose. If the data for a URI component would conflict with the reserved purpose, then the conflicting data must be escaped before forming the URI.

 reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
               "$" | ","

The "reserved" syntax class above refers to those characters that are allowed within a URI, but which may not be allowed within a particular component of the generic URI syntax; they are used as delimiters of the components described in Section 3.

It is a reserved character and signifies the start of parameters.

4
  • 3
    Yes, I know but in my URL it is encoded (instead of "?" I have "%3F") and it is working if you pass this url to your browser, but google in Google Rich Results Test or during Live Test on Google Search Console change it. If I understood your answer I can't do anything exept of changing my url?
    – Innarq
    Aug 20 at 9:41
  • 1
    From the information I have seen, it does not matter that you have it encoded. You are not allowed it. Did you look at the references? Any code that I have ever seen for manipulating the URL, assumes that ? starts the parameters. What's the big deal, just remove it. It gives you 0 credit with SEO. Have you ever seen any URL ending with a question mark? It's true that the browser ignores it, I think it's because it does not need to parse that part of it. If you insist on using bordeline things, then there is chance something else will fail later on. Aug 20 at 12:08
  • 1
    The "it does not matter that you have it encoded, you are not allowed" part is rubbish: The whole point of percent-encoding is to be able to use characters that are not safe for URLs. However, most software that decodes the percent-encodings will be reluctant to show a decoded "?" to users, because the user could confuse it with a direct, un-encoded "?". In fact, most software will not decode percent-encodings for characters that could appear directly in the URL (even if they would have special meaning), to avoid different URLs being displayed as though they were the same.
    – fNek
    Aug 20 at 14:36
  • This is indeed incorrect; any software that treats %3F as ?, i.e. it decodes the URI before splitting it in parts, does not behave according to the specification (see Why you should never unescape a URI).
    – IS4
    Aug 20 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.