Skip to main content
All CollectionsMainWP Customization
How to create a new column in the Manage Sites table
How to create a new column in the Manage Sites table
Updated over 2 weeks ago

In this document, we will go over how to add a new column to the Manage Sites table.

cURL Version column example

In this case we will add a new “cURL Version” column to the Manage Sites table but with the correct code snippet you can change it to fit your needs.

  1. Navigate to your MainWP Dashboard > Extensions > Custom Dashboard

  2. Open PHP tab

  3. Add the following code snippet:

    add_filter( 'mainwp_sitestable_getcolumns', 'mycustom_sites_table_column', 10 ); function mycustom_sites_table_column( $cols ) { $cols['child_curl_version'] = 'cURL Version'; return $cols; } add_filter( 'mainwp_sitestable_item', 'mycustom_sitestable_item', 10 ); function mycustom_sitestable_item( $item ) { $options = apply_filters( 'mainwp_getwebsiteoptions', array(), $item['id'], 'site_info' ); $website_info = json_decode( $options, true ); if ( is_array( $website_info ) && isset( $website_info['child_curl_version' ] ) ) { $item[ 'child_curl_version' ] = $website_info[ 'child_curl_version' ]; } else { $item[ 'child_curl_version' ] = ''; } return $item; }

  4. Click the Save Changes button

Navigate to the Sites > Manage Sites page, and verify that the column has been added.

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.

For more information about customizing the tables in MainWP, check out this article:
MainWP User Interface

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

  2. Open PHP tab

  3. 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; }

  4. Click the Save Changes button

Navigate to the Sites > Manage Sites page, and verify that the column has been added.

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.

For more information about customizing the tables in MainWP, check out this article: MainWP User Interface

Did this answer your question?