The WPFolks app is out on iPhone and Android. Free, no ads. Download on the App Store Get it on Google Play
Skip to main content
Login Join
Snippet · Bash

Search for a Specific Option Value in the Database

Shared by Jainil Nagar · October 7, 2026

8 views
1 upvote
Back to Snippets

Faster than opening phpMyAdmin when you need to check or debug a specific wp_options value.

Usage:

  1. Replace the option name with whatever you’re looking for.
  2. The --search flag accepts * wildcards – useful when you don’t know the exact option name a plugin uses.
  3. Use wp option update carefully – some options are serialized and should only be changed via wp search-replace
# Get any option by name
wp option get siteurl
wp option get blogname
wp option get admin_email

# Get a serialized option and have WP-CLI format it readably
wp option get active_plugins --format=json

# Search for options matching a pattern (useful for plugin options)
wp option list --search="*woocommerce*" --fields=option_name,option_value

# Update an option directly
wp option update blogname "My New Site Name"

Tested on

WordPress 7.1

Reported by the author on October 7, 2026. WPFolks has not verified this.

Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

1 comment

  1. Amit Dholiya
    Amit Dholiya @amitdholiya

    Handy WP-CLI shortcut for checking wp_options without opening phpMyAdmin. The –search wildcard is great for finding plugin options when you don’t know the exact name, and the warning about serialized values is a useful reminder to use wp search-replace instead of option update.

    Report