WordPress Plugin Redirect After Activation

Today, We want to share with you WordPress Plugin Redirect After Activation.In this post we will show you Redirect to a welcome page after updating plugin, hear for Refresh or redirect page after activate my plugin we will give you demo and example for implement.In this post, we will learn about plugin activation and deactivation hook in wordpress with an example.

WordPress Plugin Redirect After Activation

There are the Following The simple About WordPress Plugin Redirect After Activation Full Information With Example and source code.

As I will cover this Post with live Working example to develop Redirect to settings page after install, so the How to Redirect On Theme Activation for this example is following below.

Also Read This πŸ‘‰   Automatically Activate WordPress Plugins programmatically

Method : 1

How to redirect to settings page once the plugin is activated?

function your_plugin_prefix_activation_redirect( $plugin ) {
    if( $plugin == plugin_basename( __FILE__ ) ) {
        exit( wp_redirect( admin_url( 'options-general.php' ) ) );
add_action( 'activated_plugin', 'your_plugin_prefix_activation_redirect' );

Free Live Chat for Any Issue

Method : 2 Redirect after plugin activation

register_activation_hook(__FILE__, 'ntbr_plugin_activate');
add_action('admin_init', 'ntbr_plugin_redirect');

function ntbr_plugin_activate() {
    add_option('ntbr_do_activation_redirect', true);

function ntbr_plugin_redirect() {
    if (get_option('ntbr_do_activation_redirect', false)) {

Method : 3 Redirect to settings page after install

function myplugin_activate() {    
    // TODO: Install your plugin here.

    // I don't know of any other redirect function, so this'll have to do.
    // You could use a header(sprintf('Location: %s', admin_url(...)); here instead too.
register_activation_hook(__FILE__, 'myplugin_activate');

How to redirect to theme settings page after activation

use for WordPress Themes (code and paste it into functions.php)

global $plugincheck;
if ( isset( $_GET['current'] ) && $plugincheck == 'themes.php' ) {
    wp_redirect( admin_url( 'themes.php?page=theme-settings-slug' ) );

use for WordPress plugin

global $plugincheck;
if ( isset( $_GET['current'] ) && $plugincheck == 'plugins.php' ) {
    wp_redirect( admin_url( 'options-general.php?page=your-custom-plugin-page-slug' ) );

Web Programming Tutorials Example with Demo

Read :

Also Read This πŸ‘‰   Simple Laravel Query Dumper Getquerylog


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about WordPress Plugin Redirect After Activation.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.