Skip Navigation

[Resolved] Search CPT field into backen grid

This support ticket is created 3 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by davideE-4 3 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#2073755

Hi,
In the admin grid of my CPT I have added columns in view.
However, if I do a search from the form at the top right these are not managed.
How should I do to insert the new columns in the search?
Regards

#2073895
Screen Shot 2021-06-01 at 2.04.46 PM.png

Hello, if I understand correctly you have created a custom post type using Types, and you would like to use the search feature in the top right corner of the dashboard to search for these posts based on the content in all the columns displayed in the dashboard as shown in the screenshot here.

If that is correct, this type of search is not easily accomplished using Toolset's built-in features. WordPress does not search additional fields or columns by default, even in the native post types. For example, in the Posts dashboard it is not possible to search by post author name, nor to search by any custom fields you add to the dashboard table. This type of admin search would require additional custom code, or a 3rd-party plugin that provides more advanced admin search capabilities. I did a quick search and found some posts that discuss custom code approaches for extending admin search:
https://wordpress.stackexchange.com/questions/11758/extending-the-search-context-in-the-admin-list-post-screen
https://mircian.com/2017/03/29/wp-admin-search-custom-fields/
You might be able to come up with your own custom solution using information from these posts.

I also found some 3rd-party plugins that claim to provide additional admin search capabilities, but I cannot say whether or not they work well. You could try these, or search for others:
https://wordpress.org/plugins/advanced-admin-search/
https://wordpress.org/plugins/admin-search/

If you're already using the Relevanssi plugin to enhance front-end searches, that plugin can be configured to influence wp-admin searches. You might be able to leverage Relevanssi's indexing options to enhance admin searches without the need for an additional plugin.

I hope this information is helpful, let me know if you have questions.

#2075657

My issue is resolved now. Thank you!