How To Limit WordPress Search Results to Custom Post Types

This short tutorial will show you how to limit WordPress search results to specific post types when creating WordPress sites that have multiple custom post types added. To acheive this functionality we will use the WordPress pre_get_posts filter to hook into the default WordPress search query. Add this code below to your themes functions.php to […]