How can we help?

Table of Contents

How to change the default page after logging into WordPress

 

In this document, we will go over how to change the default page after logging into the WordPress installation.

We will be utilizing the built-in WordPress filter to change the default page from wp-admin/index.php to wp-admin/admin.php?page=mainwp_tab, which is the Overview page for MainWP Dashboard.

 

Using MainWP Custom Dashboard Extension

  1. Install MainWP Custom Dashboard extension
  2. Navigate to your MainWP Dashboard > Extensions > Custom Dashboard
  3. Open PHP tab
  4. Add the following code snippet
    function admin_default_page() {
    
    return 'wp-admin/admin.php?page=mainwp_tab';
    }
    
    add_filter('login_redirect', 'admin_default_page');

    How to change the default page after logging into WordPress 1

  5. Click Save Changes button

 

Editing functions.php file

  1. Navigate to the WordPress dashboard where your MainWP is installed
  2. Go to Tools > Theme File Editor
  3. On the right, locate the Theme Functions (functions.php) file and click on it
    Note: If you are not using a Child Theme, a theme update will overwrite this file. So, in that case, you can insert the snippet using a plugin like Code Snippets.
  4. Add the following code snippet to the end of the file
    function admin_default_page() {
    
    return 'wp-admin/admin.php?page=mainwp_tab';
    }
    
    add_filter('login_redirect', 'admin_default_page');
  5. Click Update File button
    How to change the default page after logging into WordPress 2
Still Have a Questions?
Search for additional solutions in the MainWP Community or start your own discussion