My site requires that people can search for terms that are included in tags and categories (towns and counties).
I'm having some resource issues using the 'Search Everything' plugin, it's causing the mysql database to lock and giving me massive slowdown. I don't blame the plugin, I blame my shared hosting.
BUT, I was wondering if I could avoid using a plugin at all by simply appending the post tags and category names to the_content within the database (instead of using a filter which I believe would only include the terms as they are rendered on the page) so that the in-built WordPress search could then be satisfactory and would find these terms.
I've read lots of different codex pages and tutorials and not found what I need, but I'm hoping someone could have a look at the following code and give their thoughts on whether it might work (I do not have a test server available at the moment and am hesitant to run it on a live site!) (Note this example includes tags only so far)
function tags_in_content($post_id, $post) {
$content = get_the_content();
$tags = get_tags();
$content->append('$tags');
}
add_action ( 'publish_post', 'tags_in_content' );
It can't be that simple can it?!
Many thanks for any help anyone can give me!