Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Include only SOME pages
This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 10 months ago.
- AuthorPosts
- July 27, 2020 at 3:00 pm #28717
Hi there!
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 #28719Hi,
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,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
July 28, 2020 at 2:47 pm #28737Thank 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 #28739Well you can use a simple plugin like this, or maybe CPTUI if you want a more complex solution (like a custom taxonomy).
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
July 28, 2020 at 3:02 pm #28740Great!
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 #28745You can exclude them here.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
July 29, 2020 at 1:17 pm #28750Great, thank you!
July 29, 2020 at 1:20 pm #28752You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.