1

This is more of a conceptual/best-practices question:

I'm integrating google custom search into a site that has about 15,000 articles. I will be using their XML/JSON feature which is a REST call with the query that gives you back the results.

The resulting JSON file has URL's (obviously) to identify the correct articles and I'm planning to loop over those URL's get their respective post_id and then query the db back to get this augmented data I need: tags/categories/other-taxonomies.

Doing this back and forth querying URL->GET_POST_ID_FROM_URL->GET_TAXONOMIES_FOR_ID seems to be very inefficient, I was looking for some ideas on how to make it more efficient without changing the permalink structure to include the post_id.

Thanks!

  • Im not sure how google custom search api work, but if it reads some kind of metadata what sounds logic to me, is to print the post id somewhere in your code. – chifliiiii Dec 18 '14 at 17:27
  • @chifliiiii If I print it in the page then it would appear as part of the "result snippet" and would almost pollute it with data which is not useful to the user.. Imagine each result in google with something like ID:N. – Amit Dec 19 '14 at 17:41
  • I meant in a meta tag or data attribute, but again im not sure how google custom search works i just throwing an idea :) – chifliiiii Dec 20 '14 at 21:24

Your Answer

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

Browse other questions tagged or ask your own question.