Wordpress Plugin Settings Data

I want to know, where are the plugin settings data stored on the server? That means, when we change any plug-in settings (for example, for a simple captcha, these are the parameters as-> use number, user alpha, captcha color, etc.), and then in which file or database these settings are saved.

+6
source share
2 answers

All plugin settings will be saved in db.

Your plugin can choose which table they would like to save the setting to. Check the source code of your plugin.

  • If your plugins use get_options() , then it will be stored in the wp_options table
  • If your plugins use get_post_meta() , then it will be saved in the wp_postmeta table
  • If your plugins use get_comment_meta() , then it will be saved in the wp_commentmeta table

The plugin can also create its own table for saving settings.

+9
source

Inside the WordPress database, you'll see a table like "wp_options". During wp installation, if you use the table prefix "xyz". Inside the database, your table name will be "xyz_options". If you use the WP Setting API and options.php, your plugin data will be saved in this table.

 <?php $data= $GLOBALS['wpdb']->get_results( 'SELECT * FROM xyz_options', OBJECT ); echo '<pre>'; print_r($data); echo '</pre>'; ?> https://codex.wordpress.org/Options_API https://codex.wordpress.org/Database_Description#Table:_wp_options https://codex.wordpress.org/Class_Reference/wpdb 
0
source

Source: https://habr.com/ru/post/913596/


All Articles