Search Regex
Does not search within custom post types (3 posts)

  1. PaulMorris
    Posted 3 years ago #

    This is very useful plugin, and I am very grateful for it. It appears that it does not search within custom post types though. That would be a very nice feature to have.


  2. KunststoffWeb
    Posted 2 years ago #

    I would like that too. In the meantime you can customize the pluins code by yourself:

    (1) Open the searchfiles in /wp-content/plugins/search-regex/searches/
    There you will find a file for each post-field you would like tocover.

    (2) For example: Customize "post_content.php"
    In line 10 you will find the following SELECT-Statement:
    $posts = $wpdb->get_results ( "SELECT ID, post_content, post_title FROM {$wpdb->posts} WHERE post_status != 'inherit' AND post_type IN ('post','page') ORDER BY ID $orderby" );

    By default "Search Regex" is only able to cover the standard post-types "post" and "page". If you have one or more custom post types you have to edit the ('post','page') in ('YOUR-CUSTOM-POST-TYPE').

  3. michelelougheed
    Posted 2 years ago #

    Hi KunststoffWeb - Thanks a lot. This worked for me for searching/replacing in the content area of other custom post types.

    But what about modifying the post_meta.php file to also search in custom post type custom fields? Any ideas on where to modify the code? It's different than the post_content.php file...

    Thanks so much for your help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Search Regex
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic