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
- Install MainWP Custom Dashboard extension
- Navigate to your MainWP Dashboard > Extensions > Custom Dashboard
- Open PHP tab
- Add the following code snippet
function admin_default_page() { return 'wp-admin/admin.php?page=mainwp_tab'; } add_filter('login_redirect', 'admin_default_page');
- Click Save Changes button
Editing functions.php file
- Navigate to the WordPress dashboard where your MainWP is installed
- Go to Tools > Theme File Editor
- 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. - 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');
- Click Update File button