0

From my research it seems that hyphen - chars are the preferred word breakers in urls in respect to SEO.

I'd like to use text in my urls for both SEO purposes and for functionality, consuming the text directly without requiring a database lookup using an id. In my case some of the text already contains hyphens so I'm wondering what is the best way for handling these in respect to SEO / conventions / readability.

For example I have the following text place name: "Boyd-Wilson Knob, Wellington"

Would it be best to encode the hyphen in the url:

/map/@-43.273331,171.960411,z12/pin/Boyd%2DWilson-Knob,-Wellington

Double hyphenate:

/map/@-43.273331,171.960411,z12/pin/Boyd--Wilson-Knob,-Wellington

Use + chars for spaces instead:

/map/@-43.273331,171.960411,z12/pin/Boyd-Wilson+Knob,+Wellington (I feel + chars aren't as human readable and might not be interpreted as word breakers by all search engines)

Just use standard encoding as it might be safer:

/map/@-43.273331,171.960411,z12/pin/Boyd-Wilson%20Knob%2C%20Wellington

Or use some other technique?

4
  • Why not boyd-wilson-knob-wellington? Commented Aug 5, 2020 at 9:45
  • @StephenOstermiller because I can't convert it directly back to "Boyd-Wilson Knob, Wellington" for use in the web app.
    – Gavin
    Commented Aug 5, 2020 at 23:57
  • The URL slug appended for SEO an usability is typically not needed to specify the content. It is usually accompanied by an ID that can be used in a database lookup. Commented Aug 6, 2020 at 1:03
  • @StephenOstermiller I addressed this in the original question. I'm trying to avoid a database lookup. I'm basically trying to create perms-links that will work in the future regardless of how the database evolves.
    – Gavin
    Commented Aug 7, 2020 at 2:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.