Skip to main content
All CollectionsMainWP Customization
How to change the default page after logging into WordPress
How to change the default page after logging into WordPress
Updated over a month ago

In this document, we will go over how to change the default page after logging into the WordPress installation. The document covers two different options to achieve this, but only one is necessary, and using both methods at the same time can cause issues.

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. Navigate to your MainWP Dashboard > Extensions > Custom Dashboard

  2. Open PHP tab

  3. Add the following code snippet

    function admin_default_page() {

    return 'wp-admin/admin.php?page=mainwp_tab';
    }

    add_filter('login_redirect', 'admin_default_page');

  4. 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
    ​

Did this answer your question?