This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Include only SOME pages

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #28717
    Mikkel Sciegiennymikkelsciegienny54
    Participant

    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?

    #28719
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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.

    #28737
    Mikkel Sciegiennymikkelsciegienny54
    Participant

    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?

    #28739
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Well you can use a simple plugin like this, or maybe CPTUI if you want a more complex solution (like a custom taxonomy).

    #28740
    Mikkel Sciegiennymikkelsciegienny54
    Participant

    Great!

    And when I’ve assigned the pages to a category, what do I do in Search WP Pro? Where, specifically, do I exclude them?

    #28745
    Ernest MarcinkoErnest Marcinko
    Keymaster
    #28750
    Mikkel Sciegiennymikkelsciegienny54
    Participant

    Great, thank you!

    #28752
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.