As you know Wordpress only searches post_content and the_title by default and with a plugin you can get it to search custom meta fields and other things. Thats great and all, but what do you go about content on the page thats not in a meta box or the content field, how do you make that searchable?

Is there a way to insert the dynamic content into post_content so that its searchable?

Is there a better way?

Any suggestions?


I'm scraping data from a 3rd party website and including it on the page via php in the template. It's on the single post.

  • 1
    Can you please tell us where these dynamic data come from ? – Subharanjan Dec 31 '13 at 1:52
  • What dynamic content are you talking about? – s_ha_dum Dec 31 '13 at 2:05
  • Custom meta-data can be stored for posts and pages without having a corresponding meta-box in the editor. If the data you are scraping is fairly static, I would recommend simply saving it in the meta-data for the appropriate page or post. The data could then be refreshed via cron. For more temporal applications the transients API may have some use. If the data changes regularly throughout the day or even in real-time, then I feel your best bet would be to save the URL of the page you are scraping in the post/page's metadata, then incorporate a search of all scraped URLs into WordPress's search – bosco Jan 1 '14 at 3:26
  • functionality. If you get a hit on any one of those external URLS, the modified WordPress search should return the local WordPress post/page that contains the "hit" URL in it's meta-data rather than a link to the URL itself. Feel me? – bosco Jan 1 '14 at 3:28
  • To be clear, I mean that your modified WordPress search should additionally perform searches directly on the live contents of all external URLs that are being ripped, but return your own WordPress posts and pages in place of any "hit" external URLs in the search results. I'll try to elaborate more on all of this in an answer once we shake the hold ;) – bosco Jan 1 '14 at 3:31

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.