Add WordPress plugin settings link

Add Plugin Settings Link to WordPress Plugins Page

If you’re building your own custom plugin for WordPress and it has options attach to it, it would be nice if users know where the plugin settings page is. I see some WordPress plugins settings page not so easy to find.

First place to look is obviously under the Settings menu in WordPress dashboard but what the plugin developer put the plugin settings page on a different location and put it under other default WordPress dashboard menu. It would take some time to look for the settings page.

Wouldn’t be nice to help our plugin users to easily find where to find the plugin settings page? Luckily, we can add a custom link in WordPress > Plugins page.

You simply need to place this lines anywhere in your functions.php file.

function your_plugin_settings_link($links) { 
  $settings_link = '<a href="options-general.php?page=plugin-options.php">'. esc_html__('Settings', 'your-text-domain') .'</a>'; 
  array_unshift($links, $settings_link); 
  return $links; 
}
$plugin = plugin_basename(__FILE__); 
add_filter("plugin_action_links_$plugin", 'your_plugin_settings_link' );

That’s wasn’t too difficult isn’t? Just a small effort from us as plugin developer to help our users in finding the settings page easily.

Leave a Comment

Your email address will not be published. Required fields are marked *