1

Is there any problem if I rewrite search URLs to something like:

example.com/search.php?q=search+term

to

example.com/search-site/search-term/

I mean negative effects for search engine, Google ranking, etc.

I would then also like to use ld+json to let Google know about my site search:

  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://example.com/search-site/{q}/",
    "query-input": "required name=q"
  }

I have read google documentation about Sitelinks Searchbox but there is nothing about URL structure. Can use it in this way?

0

Site search pages should never be an SEO concern. Your site search pages are not something that Google wants in their search index. See Matt Cutts: Search results in search results. If Google discovers that you are trying to get your site search pages indexed, they may penalize your ENTIRE site. You should disallow site search in robots.txt:

Disallow: /search.php
Disallow: /search-site/

Given that site search pages should not be indexed, there is no possible SEO advantage to using "SEO friendly" URLs for site search.

There are other problems with rewritten site search URLs as well:

  • Your search form won't be able to submit to them. You'd either have to power your search form with JavaScript or use a redirect every time somebody searched.
  • Your SearchAction markup won't work because search terms are URL encoded. Spaces are %20, but your example has a dash in place of the space.
2
  • Ok so i can just remove php from search, example.com/search?q=search+term, disallow /search in robots.txt and should be fine? – marko_djoric Sep 27 '18 at 20:05
  • Yes, that would be fine. – Stephen Ostermiller Sep 29 '18 at 5:46

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.