Today, we’ll introduce a little piece of code that does something pretty cool and comes in handy while troubleshooting WordPress. The below code snippet will add an additional option to your settings menu called "all settings" that can show you a complete alphabetical list of all the hidden settings you have within your wp_options table.
The best thing is that the below code will enable you to adjust any of the settings and save it as per your requirement from the WordPress dashboard itself, with the exception of those that WordPress stores as serialized data. In addition, the “All settings” tab can only be viewed by the admin users.
Warning: This tutorial is only for advanced WordPress users. Please don’t try this if you’re not sure what you’re doing. If something goes wrong, this can destroy your database and break your site. You’ve been warned!
Also, take a WordPress backup before you proceed.
Add the following code to functions.php file to display hidden features in the settings tab.
// CUSTOM ADMIN MENU LINK FOR ALL SETTINGS
function all_settings_link() {
add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php');
}
add_action('admin_menu', 'all_settings_link');
Once added, here is what the ‘all settings’ menu will look like.
The best thing is it allows you to find out if your options table needs a clean up without logging in to phpmyadmin. It also helps you to change the plugin settings that are not offered to normal users.
Are you interested in learning other tips and tricks about WordPress, check out our detailed post here!
Please leave a useful comment with your thoughts, then share this on your Facebook group(s) who would find this useful and let's reap the benefits together. Thank you for sharing and being nice!
Disclosure: This page may contain links to external sites for products which we love and wholeheartedly recommend. If you buy products we suggest, we may earn a referral fee. Such fees do not influence our recommendations and we do not accept payments for positive reviews.