Add Custom Plugin Action Links in WordPress | PHP Tutorial

By default, a self-developed WordPress plugin only has an activate/deactivate link in the plugins overview.

WordPress Plugin Overview with Custom Links
Plugin overview with custom link – Using the “Astra Pro” plugin as an example.

If additional links are planned for the plugin overview, such as a link to further settings, this must be done via a filter.

add_filter('plugin_action_links_' . plugin_basename(__FILE__),
    function ($links) {
    $links[] = '<a href="replace-me">Settings</a>';
    return $links;
});

In the filter, you can specify both the name of the link and the corresponding target. You can also add as many links as you want here – there is no limit.