Results 1 to 11 of 11
  1. #1
    baldidiot is online now Private Member
    Join Date
    January 2010
    Posts
    4,344
    Thanks
    406
    Thanked 1,984 Times in 1,308 Posts

    Default Limit wordpress admin search to post title

    Anyone know a decent way of doing this? It's driving me nuts when you search for something and you get three pages of posts that happen to mention the term before the post with that title.

    Found a couple of functions online but none seem to work very well with the current WP version and throw out errors.
    onlinegamblingwebsites.com - Formally known as goodbonusguide.

  2. #2
    Strider1973's Avatar
    Strider1973 is offline Private Member
    Join Date
    November 2012
    Posts
    315
    Thanks
    217
    Thanked 202 Times in 134 Posts

    Default

    Where do you search? On your website like a user, or in the backend as an admin?

    As an admin, you can make the normal search, increase the number of results to 100 per page (instead of the standard 20) and then just search again on the website for the desired text.

    Otherwise you might want to try a plugin like Relevanssi. The pricing for the premium version is just a bit a joke - like it is for many premium plugins nowadays.
    "Semper paratus!"
    My BTC Address: 1F11EJvSAab5vMQgGWGQMASr9T7LCkZjvb

  3. #3
    Mattbar's Avatar
    Mattbar is offline Private Member
    Join Date
    July 2015
    Location
    London
    Posts
    807
    Thanks
    64
    Thanked 575 Times in 339 Posts

    Default

    Quote Originally Posted by baldidiot View Post
    Anyone know a decent way of doing this? It's driving me nuts when you search for something and you get three pages of posts that happen to mention the term before the post with that title.

    Found a couple of functions online but none seem to work very well with the current WP version and throw out errors.

    I don't know the answer but also very keen to find out as I find it infuriating.

  4. #4
    baldidiot is online now Private Member
    Join Date
    January 2010
    Posts
    4,344
    Thanks
    406
    Thanked 1,984 Times in 1,308 Posts

    Default

    Quote Originally Posted by Strider1973 View Post
    Where do you search? On your website like a user, or in the backend as an admin?
    On the back end when looking for an article to edit. Eg: if you have an article about the grand national and you search for that, I want the article with the terms 'Grand National' to appear rather than 300 vaguely related posts.



    Quote Originally Posted by Strider1973 View Post
    As an admin, you can make the normal search, increase the number of results to 100 per page (instead of the standard 20) and then just search again on the website for the desired text.
    Yeah I guess. Seems daft though. Also some of our sites have thousands of posts so if the text is fairly common it might not even be on the first page.



    Quote Originally Posted by Strider1973 View Post
    Otherwise you might want to try a plugin like Relevanssi. The pricing for the premium version is just a bit a joke - like it is for many premium plugins nowadays.
    I did actually see that one. Problem is it's way more than needed and has a pretty big database overhead which again seems daft when trying to simplify the site.


    Still seems weird to me that this isn't the default action in WP anyway (or an option at least).
    onlinegamblingwebsites.com - Formally known as goodbonusguide.

  5. #5
    ddm
    ddm is offline Public Member
    Join Date
    July 2006
    Posts
    1,034
    Thanks
    382
    Thanked 436 Times in 264 Posts

  6. #6
    Michael Martinez is offline Public Member
    Join Date
    March 2017
    Location
    USA
    Posts
    76
    Thanks
    8
    Thanked 48 Times in 29 Posts

    Default

    Haven't tested it yet but now that I know it exists, I will.

    WP Extended Search – WordPress plugin | WordPress.org

    WP Extended Search is a lightweight and powerful search plugin.

    With this plugin you can customize WordPress search to search in Post Meta, Author names, Categories, Tags, or Custom Taxonomies via admin settings. You can control the default behavior of WordPress to search in the post title, post content, and post excerpt.


    Apart from customizing default search behavior, you can create multiple search settings, and then you can assign these settings to custom search forms.
    For custom search forms, you have the option to choose from a widget, shortcode, PHP function, or HTML.

  7. #7
    baldidiot is online now Private Member
    Join Date
    January 2010
    Posts
    4,344
    Thanks
    406
    Thanked 1,984 Times in 1,308 Posts

    Default

    That's the puppy, thanks!
    onlinegamblingwebsites.com - Formally known as goodbonusguide.

  8. #8
    baldidiot is online now Private Member
    Join Date
    January 2010
    Posts
    4,344
    Thanks
    406
    Thanked 1,984 Times in 1,308 Posts

    Default

    Quote Originally Posted by Michael Martinez View Post
    Haven't tested it yet but now that I know it exists, I will.

    WP Extended Search – WordPress plugin | WordPress.org
    I did actually try this one earlier today but it seemed to only work on the front end rather than the back end.
    onlinegamblingwebsites.com - Formally known as goodbonusguide.

  9. The Following User Says Thank You to baldidiot For This Useful Post:

    Michael Martinez (29 April 2021)

  10. #9
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Courage is being scared to death...and saddling up anyway. John Wayne
    Posts
    27,660
    Thanks
    2,117
    Thanked 7,839 Times in 4,942 Posts

    Default

    Although I do not know a simple plugin that can help with the search, I imagine one could write a custom query for the database to find pages or posts by slug or id.

    If you are wanting to edit a specific page and you know the url, you can log in to the backend, then hit the page in the browser, then you can just choose edit in the admin bar, and it should load the specific page or post in your backend editor.

    Rick
    Universal4

  11. #10
    ddm
    ddm is offline Public Member
    Join Date
    July 2006
    Posts
    1,034
    Thanks
    382
    Thanked 436 Times in 264 Posts

    Default

    Quote Originally Posted by baldidiot View Post
    That's the puppy, thanks!
    pleasure dude.

    you will need to add this code at start of function or it will trigger for all site searches [not just loggedin/admin] fwiw:

    PHP Code:
    if( !is_admin() )
            return; 

  12. #11
    baldidiot is online now Private Member
    Join Date
    January 2010
    Posts
    4,344
    Thanks
    406
    Thanked 1,984 Times in 1,308 Posts

    Default

    Quote Originally Posted by universal4 View Post
    If you are wanting to edit a specific page and you know the url, you can log in to the backend, then hit the page in the browser, then you can just choose edit in the admin bar, and it should load the specific page or post in your backend editor.
    Yeah that's what I've been doing up to now but seems daft that there's a search feature in the back end that's just useless.


    Quote Originally Posted by ddm View Post
    you will need to add this code at start of function or it will trigger for all site searches [not just loggedin/admin] fwiw:
    Good to know, thanks!
    onlinegamblingwebsites.com - Formally known as goodbonusguide.

  13. The Following User Says Thank You to baldidiot For This Useful Post:

    universal4 (30 April 2021)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •