• Dear WordPress Devs,

    my first ever developed wordpress plugins reads out a table from another database and prints its content as HTML into a wordpress site. After analysing some search queries and statistics, I found out, that the content which is displayed via my plugin is not crawled. It also seems like the wordpress search is not able to find it. This is worse because its one of my most important stuff on my site. Is there some way to fix it? Copy and pasting all that generated content would be a mess.
    Since I’m no real developer, I would be really grateful for some hints or tutorials.

    Thank you in advance!

Viewing 16 replies (of 16 total)
  • Moderator bcworkz

    (@bcworkz)

    https://duckduckgo.com/?t=ffsb&q=mysql+tutorial&ia=web ? ??

    The specifics depend on where this other data resides and what schema is used. But you apparently know how to do this from developing your plugin, so I think I’m misunderstanding your question.

    Taking a different interpretation, the WP search invokes a new WP_Query object, passing search terms a the 's' argument.
    https://developer.www.ads-software.com/reference/classes/wp_query/

    The returned posts reside in WP_Query::posts. You need to somehow merge these with your supplemental query results. If you want the other results to appear like the other posts in output, you’d need to create WP_Post objects out of the data. Nothing that is saved anywhere, but the WP loop generating the output expects all post objects in the search query’s posts array. You’d be dynamically creating virtual post objects.

Viewing 16 replies (of 16 total)
  • The topic ‘Using wordpress search on own plugin / database’ is closed to new replies.