Skip to content

Instantly share code, notes, and snippets.

@otakupahp
Last active September 21, 2022 09:18
Show Gist options
  • Save otakupahp/48f3b5d76f1283b99226b071ae378b36 to your computer and use it in GitHub Desktop.
Save otakupahp/48f3b5d76f1283b99226b071ae378b36 to your computer and use it in GitHub Desktop.
Run Jetpack Instant Search locally
-- Replace table name as needed
SELECT * FROM `wp_options` WHERE `option_name` LIKE '%jetpack_search%' ORDER BY option_name ASC;
<?php
// If we are on localhost, force Jetpack online
if ( defined( 'WP_LOCAL_DEV' ) && WP_LOCAL_DEV ) {
add_filter( 'jetpack_offline_mode', '__return_false' );
}
@otakupahp
Copy link
Author

otakupahp commented May 6, 2022

REQUIREMENT

  • Jetpack Instant Search must be active in a staging site, this won't work if you use a Live version
  • Jetpack installed in your local environment

Run the SQL in your staging database, you should get something like this:
imagen

Copy the options jetpack_search_plan_info and jetpack_search_ever_supported_search into your local database

Note: If you can't access the staging database but have the SQL, you can do a manual search with a text editor, or import the DB locally and look for that data there.

Add the PHP filter at your functions.php file, inside a plugin or a mu-plugin.

If you access to the Jetpack dashboard, and you won't see the Search menu, you could access manually by adding admin.php?page=jetpack-search to the wp-admin path

To configure the search, paste admin.php?page=jetpack-search-configure to the wp-admin path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment