Search Custom Fields in Dashboard Post Search (2 posts)

  1. equalmark
    Posted 5 years ago #

    I have a site where jobs are stored as posts. Each post has a specific job ID which is stored as a custom field (I couldn't use the post ID as the job ID as it had to be a certain number).

    What I need is a way to search for posts via the custom field job iD value. By this I mean a user can use the 'search' box on the post listing screen in the dashboard to type in a job ID and then WordPress will include custom fields in the search as well as titles and content etc.

    The good news is I found the following plugin online:


    The bad news is, is that is works really well, but for some reason once activated, the posts listings displays all posts more than once. See screenshot below:

    When activated post listing looks like this: http://files.equalwebcreative.com/testfiles/cm_post_problem.jpg

    It should, of course looks like this: http://files.equalwebcreative.com/testfiles/cm_post_correct.jpg

    Does anyone have a clue as to why it is doing this, it is a little beyond my expertise?

    Thanks in advance for your assistance.

  2. equalmark
    Posted 5 years ago #

    It seems to be something to do with the post_join filter because if I comment out that line inside the post_searches_meta function it displays correctly but doesn't actually search custom fields then!

    Therefore I think it must be something to do with the join function towards the bottom. I am no MySQL expert though so maybe someone could help.

    Thanks again in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic