1

I have a search page for our sites that carries out search depending on the values of the following parameters in the query string;

q: search string cats: comma separated string matches products belonging to multiple categories tags: comma separated string matches products having specific tags

I am now planning to include metadata and OG keywords as part of the query string for the purposes of advertising on Facebook. E.g. to have OG image source, OG Title and OG description in the query string will allow me to customise a single page (search results) depending on my requirements.

For example if I wanted to advertise dairy products, my URL would read (not encoded for brevity here):

results/tags=milk,cheese,yoghurt&ogimage=img/social/dairy-cover.png&ogtitle=Some Title&ogdesc=some description

Similarly I would use the following for house cleaning;

results/cats=home-cleaning&ogimage=img/social/house-cleaning.png&ogtitle=Cleaning products&ogdesc=some more description

I also intend to extend this approach to include other parts of querystring so that I can also have different content in the page. For example If I also want to include a related products carousel after the search results;

results/{same-as-above}&carouselId=3

What I want to find out, if;

  • this approach is a good or bad practise since anyone can change the query string.
  • if it has any disadvantages in terms of SEO
  • I should have search engine indexing concerns due to the fact that I am serving a single page - different query string
  • if there are any security issues I should be aware of.
  • Any other considerations I need to have a look at.

Thanks in advance

1
  • Please clarify... the example URLs you've posted don't include a "query string" since you are missing the ?. Consequently, the query string-like data is part of the URL-path? – MrWhite Jul 22 at 15:29
0

this approach is a good or bad practise since anyone can change the query string.

Yes, that would be my main concern... "anyone" (read: any malicious user or bot) can manipulate the URL and change the on-page content. A bot could substitute any malicious keywords in the ogtitle and ogdesc parameters and flood your site with 1000s of undesirable URLs (wasting server resources) that potentially get indexed (although see the next part below) and you then have a very real problem.

I don't see why the OG data should be included in the URL? You presumably know the OG data in order to generate the URL in the first place? In which case this should presumably be "looked up" based on known tags. (?)

if it has any disadvantages in terms of SEO

If you are allowing these URLs to be indexed then this is a problem for SEO.

However, site-search results should not be allowed to be indexed by search engines. Google does not want to index your search results, it wants to index your pages.

So, assuming you are following best practice and not allowing these URLs to be indexed then "SEO" is not an issue.

I should have search engine indexing concerns due to the fact that I am serving a single page - different query string

Again, search results pages should not be indexed by search engines in the first place.

Strictly speaking, different query strings creates different URLs and therefore different "pages". The fact that you have a single end-point that processes this URL is mostly irrelevant.

if there are any security issues I should be aware of.

The potential "abuse" as mentioned above.

Any other considerations I need to have a look at.

An unnecesarily long URL that could be indavertantly "split" when shared and create potentially invalid URLs.

1
  • Thank you for detailed answer. I am now moving forward with the approach of clean URLs with proper routing for those pages that I want to get indexed and I will keep OG tags embedded in code to prevent abuse. Search results will stay as a seperate page. Your answer really helped to clear the clouds in my mind. – Subliminal Hash Jul 23 at 7:08
0

What you seem to be effectively doing is building an archive page of sorts, where you plan to list different types of products. A category page.

A smarter approach would be to implement better looking routes such as /category/home-cleaning, /tag/milk.

You could then create a separate list of category and tag page list in your sitemap. Your custom OG tags, and additional scripts for tracking category views could also be added to this.

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.