[Solved] WP Knowledgebase publications (kbe_knowledgebase) do not show in search results
-
There is a nice plugin that allows you to create your own knowledgebase using Wordpress.
But unfortunately, it's authors decided to disable search for all articles with its custom post_type (which iskbe_knowledgebase). As a result, WP Knowledgebase articles do not show in WPFTS search results. However, these articles are indexed well and you can see them while test the search in Sandbox.To fix this, we have to re-enable the search for Knowledgebase posts.
Please put this small code snippet to your
functions.phpfile in the main theme root.add_action( 'registered_post_type', function( $post_type, $args ) { // Make sure we're only editing the post type we want if ( 'kbe_knowledgebase' != $post_type ) return; $args->exclude_from_search = false; // Modify post type object global $wp_post_types; $wp_post_types[$post_type] = $args; }, 10, 2 );What does it do? Pretty simple. The flag
exclude_from_searchwas set totrueinside the WP Knowledgebase plugin and thus, these custom posts are not included to search.This simple snippet fixes this.
Have fun!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login