Support » Fixing WordPress » Search Order of pages

  • Hi guys,

    I have tried searching but the exact thing i am trying to find is becoming elusive.
    All i want to do is change the results of a search query within wordpress.

    For example i have an order page and a terms and conditions page but both contain a key search word.
    So searching for infinity on our site would bring up the terms and conditions pages first then the actual landing/purchase pages. i need to swap this around if possible. Any help or pointers would be brilliant.

    Thanks in advance
    Steve

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is what I would do:

    https://www.johnparris.com/exclude-certain-pages-from-wordpress-search-results/

    Just add that to functions.php, but update the page ID’s in the array to the page ID’s you would prefer to not come up in search.

    That simply removes the pages from appearing in your search results (I’m guessing that people do not want to search on your site to find the Terms page).

    Hope that helps.

    https://codex.wordpress.org/Function_Reference/the_search_query

    Thread Starter Steve Hirons

    (@stevehirons)

    Hi,

    I am already using search exclude but if someone searches for infinity, the landing page for the packages need to come up but also the terms and conditions should come up too but not first if you see what i mean, so the terms pages are coming up first then the packages, i just want these the other way round. I have home, business and laser infinity packages but also terms and conditions for each package. So excluding infinity from the search may be too harsh. Just want to change the order in which the results are displayed if such a thing is possible.

    thanks
    steve

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search Order of pages’ is closed to new replies.