Custom Plan Settings Tabs in WooCommerce Memberships

In this tutorial I would like to share with you how I figured in out the way of creating custom settings tabs on “Edit Memberships Plan” pages.

I needed to add a custom tab there for settings of my Simple Mailchimp Sync plugin.

And right now in this tutorial we are going to create a simple tab like this:

Create a custom plan settings tab in WooCommerce Memberships

The good news is that WooCommerce Memberships plugin is customizable with hooks, actually there are two of them we need:

In order to add a tab we just have to do the following:

add_filter( 'wc_membership_plan_data_tabs', 'rudr_memberships_tab' );

function rudr_memberships_tab( $tabs ) {
	$tabs[ 'rudrmailchimp' ] = array(
		'label'  => 'Mailchimp',
		'target' => 'rudr_mailchimp' // ID of the HTML tab body element
	return $tabs;

The tab will appear but it is not going to work or do anything actually. Now it is time to add some tab HTML. I am going to display a single input field there.

add_action( 'wc_membership_plan_data_panels', 'rudr_tab_content' );

function rudr_tab_content(){
	$list_id = get_post_meta( get_the_ID(), 'rudr_list_id', true );

	?><div id="rudr_mailchimp" class="panel woocommerce_options_panel">
		<div class="table-wrap">
			<p>Please, enter the Mailchimp list ID to synchronize active users of this plan with it.</p>
			<div class="options_group">
				<?php wp_nonce_field( basename( __FILE__ ), 'rudr_mchimp_nonce' ); ?>
				<p class="form-field post_name_field">
					<label for="rudr_list_id">List ID:</label>
					<input type="text" name="rudr_list_id" id="rudr_list_id" value="<?php echo esc_attr( $list_id ) ?>" />

And the final step is to save the data into post meta. You can use save_post or save_post_{CPT} for this purpose.

add_action( 'save_post_wc_membership_plan', 'rudr_membership_save', 10, 2 );

function rudr_membership_save( $post_id, $post ){
	if ( ! isset( $_POST[ 'rudr_mchimp_nonce' ] ) || ! wp_verify_nonce( $_POST[ 'rudr_mchimp_nonce' ], basename( __FILE__ ) ) ) {
        	return $post_id;

	update_post_meta( $post_id, 'rudr_list_id', sanitize_text_field( $_POST[ 'rudr_list_id' ] ) );
	return $post_id;

Almost forgot about the icons! The plan settings tabs are using the icons from Dashicons set. You can easily set a custom icon for a tab via CSS.

.wc-memberships#wc-memberships-membership-plan-data ul.wc-tabs li.rudrmailchimp_options a:before{
	content: "\f463";
Misha Rudrastyh

Misha Rudrastyh

Hey guys and welcome to my website. For more than 10 years I've been doing my best to share with you some superb WordPress guides and tips for free.

Need some developer help? Contact me

Follow me on X