Include only SOME pages

This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #28717
    Mikkel Sciegienny
    mikkelsciegienny54
    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 Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #28737
    Mikkel Sciegienny
    mikkelsciegienny54
    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 Marcinko
    Ernest 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).

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #28740
    Mikkel Sciegienny
    mikkelsciegienny54
    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 Marcinko
    Ernest Marcinko
    Keymaster

    You can exclude them here.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #28750
    Mikkel Sciegienny
    mikkelsciegienny54
    Participant

    Great, thank you!

    #28752
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.