Title: Fixed search query when changing post types?
Last modified: April 18, 2024

---

# Fixed search query when changing post types?

 *  Resolved [diegonorzex](https://wordpress.org/support/users/diegonorzex/)
 * (@diegonorzex)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/fixed-search-query-when-changing-post-types/)
 * Hi, what I am trying to achieve is in the demo page:
 * [https://typesense.codemanas.com/](https://typesense.codemanas.com/)
 * and I search for something, the search term is fixed when changing between the
   Books – Blog – Pages tab. Right now, when I type something and then change post
   type the query term is erased.
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [CodeManas](https://wordpress.org/support/users/codemanas/)
 * (@codemanas)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/fixed-search-query-when-changing-post-types/#post-17707010)
 * Hello [@diegonorzex](https://wordpress.org/support/users/diegonorzex/) ,
 * We have updated the plugin to 2.0.2 with new hook `cm_typesense_additional_config`
   which you can use like this below to preserve search term on changing between
   tabs.
 *     ```wp-block-code
       <?php
       add_filter( 'cm_typesense_additional_config', 'theme_slug_cm_ts_additional_configs' );
        function theme_slug_cm_ts_additional_configs() {
            return [
                'preserve_search' => true,
            ];
        }
       ```
   
    -  This reply was modified 2 years, 1 month ago by [CodeManas](https://wordpress.org/support/users/codemanas/).
 *  Thread Starter [diegonorzex](https://wordpress.org/support/users/diegonorzex/)
 * (@diegonorzex)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/fixed-search-query-when-changing-post-types/#post-17716067)
 * Thank you! Works great
 * BTW I uploaded the spanish translation of the plugin if you want to validate 
   it!
    -  This reply was modified 2 years, 1 month ago by [diegonorzex](https://wordpress.org/support/users/diegonorzex/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Fixed search query when changing post types?’ is closed to new replies.

 * ![](https://ps.w.org/search-with-typesense/assets/icon-256x256.png?rev=3095079)
 * [Search with Typesense](https://wordpress.org/plugins/search-with-typesense/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/search-with-typesense/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/search-with-typesense/)
 * [Active Topics](https://wordpress.org/support/plugin/search-with-typesense/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/search-with-typesense/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/search-with-typesense/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [diegonorzex](https://wordpress.org/support/users/diegonorzex/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/fixed-search-query-when-changing-post-types/#post-17716067)
 * Status: resolved