This topic contains 7 replies, has 2 voices, and was last updated by
- July 27, 2020 at 3:00 pm #28717
I’ve created a form, where I’d like the search to be able to search on ALL of the website’s posts – but only some specific pages.
The way I’ve done it previously is to include all pages as being searchable, then exclude pages by ID as I go along.
However, it’d be much easier, if I could just add 10-12 page IDs to be included in the search.
So, what’s the best way to create a search form that searches in all posts and specific pages?July 27, 2020 at 3:12 pm #28719
Well, there is an option to include the results by IDs, but the problem is, that all post types are stored in the same table in WordPress – including posts and pages. That means, that restricting by IDs applies to posts as well, so you would only get pages 10-12 in the results, nothing else.
The best option is probably adding the pages to categories or other taxonomy, and exclude that. Then later on, you can just move the pages you don’t need to the excluded category.Best,
If you like my products, don't forget to rate them on codecanyon :)
July 28, 2020 at 2:47 pm #28737
Thank you for the quick reply, Ernest!
It’s not really the process I was hoping for, but I appreciate the response.
How, specifically, do I go about adding those pages to a category/taxonomy and then exclude them in Ajax Search Pro?July 28, 2020 at 2:59 pm #28739July 28, 2020 at 3:02 pm #28740
And when I’ve assigned the pages to a category, what do I do in Search WP Pro? Where, specifically, do I exclude them?July 29, 2020 at 8:29 am #28745July 29, 2020 at 1:17 pm #28750
Great, thank you!July 29, 2020 at 1:20 pm #28752
You must be logged in to reply to this topic.