Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

Update:

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.

share|improve this question
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 –  boscho Jan 1 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? –  boscho Jan 1 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 ;) –  boscho Jan 1 at 3:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.