Table of Contents

How to add a ‘Go to site’ icon to Manage Sites table

In this document, we will go over how to add a ‘Go to site’ icon to the Manage Sites table.

This may be useful if you don’t have a URL column in your table, but would still like to be able to quickly open a Child Site in a new tab.
Additionally, since the icon takes up less space than a URL, it can also be visible in the mobile version of the table without expanding the Child Site row.

  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
    add_filter( 'mainwp_sitestable_getcolumns', 'mycustom_mainwp_sitestable_getcolumns', 10, 1 );
    function mycustom_mainwp_sitestable_getcolumns( $columns ) {
    	$columns['front_page_link'] = '';
    	return $columns;
    }
    
    add_filter( 'mainwp_sitestable_item', 'mycustom_mainwp_sitestable_item', 10, 1 );
    function mycustom_mainwp_sitestable_item( $item ) {
    	$item['front_page_link'] = '';
    	return $item;
    }
    
  5. Click the Save Changes button

Navigate to the Sites > Manage Sites page, and verify that the column has been added.
How to add a 'Go to site' icon to Manage Sites table 1

Drag and drop it to the desired spot. If it’s placed near the beginning of the table, it will also be visible in the mobile version without expanding the Child Site row.
How to add a 'Go to site' icon to Manage Sites table 2

For more information about customizing the tables in MainWP, check out this article: https://kb.mainwp.com/docs/customizing-tables-on-mainwp-dashboard/

Still Have a Questions?
Search for additional solutions in the MainWP Community or start your own discussion