Elementor is a formidable instrument for construction WordPress web sites, however its dashboard can occasionally really feel cluttered with upsell commercials and activates for top rate options.

On this information, I’ll display you ways to take away maximum Elementor upsells, permitting you to experience a cleaner, extra targeted interface. You’ll observe alongside the information and upload the code for your customized theme or you’ll skip the information and obtain the at hand plugin on Github as a substitute.

Sooner than we dive in, it’s price bringing up that the most simple method to take away Elementor upsells is by means of buying and putting in Elementor Professional (associate hyperlink). That is what I like to recommend, then again, now not everybody wishes the additional options, or is probably not in a position to decide to the continued price.

This information is also debatable, however right here’s my standpoint: whilst I absolutely perceive the wish to generate earnings, I consider that while you create a unfastened GPL product, customers will have to have the liberty to switch it as they see have compatibility.

Once more, I strongly counsel you buy Elementor Professional to get right of entry to heaps of superior options and make stronger from the builders. Take a look on the Elementor Unfastened vs Professional article on their website to peer what you possibly can be lacking out on!

In case you’re now not in a position to improve to the professional model and like sticking with the unfastened one, stay studying to learn to take away the upsells for a cleaner person interface.

TL;DR Skip to the ultimate code & plugin

WPEX_Remove_Elementor_Upsells PHP Elegance

Let’s get started by means of growing our PHP magnificence which is able to dangle the entire code important to take away Elementor upsells. This may stay the entirety tidy and structured. On the peak of the category, we’ll come with a take a look at to be sure that should you improve to Elementor Professional, not anything will get got rid of or affected.

This is our starter magnificence:

/**
 * Take away Elementor Upsells.
 */
magnificence WPEX_Remove_Elementor_Upsells {

	/**
	 * Constructor.
	 */
	public serve as __construct() {
		if ( did_action( 'elementor/loaded' ) ) {
			$this->register_actions();
		} else {
			add_action( 'elementor/loaded', [ $this, 'register_actions' ] );
		}
	}

	/**
	 * Check in our major magnificence movements.
	 */
	public serve as register_actions(): void {
		if ( is_callable( 'ElementorUtils::has_pro' ) && ElementorUtils::has_pro() ) {
			go back; // bail early if we're the usage of Elementor Professional.
		}

		// We can do issues right here...
	}
	
}

new WPEX_Remove_Elementor_Upsells;

In the rest of this educational, we’ll be including new code inside of this magnificence. It’s vital to observe alongside carefully, as skipping any phase may reason you to omit crucial code. On the other hand, you’ll skip forward to the tip and duplicate your complete ultimate model of the category.

Elementor extra pages

Elementor registers quite a lot of admin pages that don’t in reality do anything else but even so show a touchdown web page to improve to the professional model. We’re going to first take away the next pointless pages:

  • Submissions
  • Customized Fonts
  • Customized Icons
  • Customized Code
  • Upload-ons (Bonus)

We’ll get started out by means of updating our register_actions approach to seem like this:

/**
 * Check in our major magnificence movements.
 */
public serve as register_actions(): void {
	if ( is_callable( 'ElementorUtils::has_pro' ) && ElementorUtils::has_pro() ) {
		go back; // bail early if we're the usage of Elementor Professional.
	}

	add_action( 'elementor/admin/menu/after_register', [ $this, 'remove_admin_pages' ], PHP_INT_MAX, 2 );
}

Then we’ll upload a brand new means named remove_admin_pages to the category which is able to seem like this:

/**
 * Take away admin pages.
 */
public serve as remove_admin_pages( $menu_manager, $hooks ): void {
	$pages_to_remove = [];
	$subpages_to_remove = [];
	if ( is_callable( [ $menu_manager, 'get_all' ] ) ) {
		foreach ( (array) $menu_manager->get_all() as $item_slug => $merchandise ) {
			if ( isset( $hooks[ $item_slug ] )
				&& is_object( $merchandise )
				&& ( is_subclass_of( $merchandise, 'ElementorModulesPromotionsAdminMenuItemsBase_Promotion_Item' )
					|| is_subclass_of( $merchandise, 'ElementorModulesPromotionsAdminMenuItemsBase_Promotion_Template' )
				)
			) {
				$parent_slug = is_callable( [ $item, 'get_parent_slug' ] ) ? $item->get_parent_slug() : '';
				if ( ! empty( $parent_slug ) ) {
					$subpages_to_remove[] = [ $parent_slug, $item_slug ];
				} else {
					$pages_to_remove[] = $hooks[ $item_slug ];
				}
			}
		}
	}
	foreach ( $pages_to_remove as $menu_slug ) {
		remove_menu_page( $menu_slug );
	}
	foreach ( $subpages_to_remove as $subpage ) {
		remove_submenu_page( $subpage[0], $subpage[1] );
	}
}

This code hooks takes good thing about a at hand hook within the Elementor plugin so we will be able to dynamically get a listing of promotional admin pages and take away them.

Take away the Upload-ons Web page

It’s possible you’ll in finding the Upload-ons panel helpful because it’s a option to find plugins appropriate with Elementor that offer further capability. Then again, these kind of are top rate add-ons (aka commercials) and should you aren’t purchasing Elementor Professional, you’re going to most probably now not be purchasing anything else from this web page both.

To take away the add-ons web page we’ll replace the former approach to have an additional take a look at like so:

/**
 * Take away admin pages.
 */
public serve as remove_admin_pages( $menu_manager, $hooks ): void {
	$pages_to_remove = [];
	$subpages_to_remove = [];
	if ( is_callable( [ $menu_manager, 'get_all' ] ) ) {
		foreach ( (array) $menu_manager->get_all() as $item_slug => $merchandise ) {
			if ( isset( $hooks[ $item_slug ] )
				&& is_object( $merchandise )
				&& ( is_subclass_of( $merchandise, 'ElementorModulesPromotionsAdminMenuItemsBase_Promotion_Item' )
					|| is_subclass_of( $merchandise, 'ElementorModulesPromotionsAdminMenuItemsBase_Promotion_Template' )
					|| 'elementor-apps' === $item_slug
				)
			) {
				$parent_slug = is_callable( [ $item, 'get_parent_slug' ] ) ? $item->get_parent_slug() : '';
				if ( ! empty( $parent_slug ) ) {
					$subpages_to_remove[] = [ $parent_slug, $item_slug ];
				} else {
					$pages_to_remove[] = $hooks[ $item_slug ];
				}
			}
		}
	}
	foreach ( $pages_to_remove as $menu_slug ) {
		remove_menu_page( $menu_slug );
	}
	foreach ( $subpages_to_remove as $subpage ) {
		remove_submenu_page( $subpage[0], $subpage[1] );
	}
}

All we did used to be upload || 'elementor-apps' === $item_slug to the the if observation.

Elementor top bar admin add-ons link

In case you got rid of the Upload-ons web page you’ll additionally need to take away the hyperlink within the Elementor peak bar. Another way, if any individual clicks at the hyperlink it is going to take them to a WordPress error web page with the caution “Sorry, you aren’t allowed to get right of entry to this web page.”.

To stay issues easy what we’ll do is upload just a little customized CSS within the WP admin that hides the hyperlink the usage of the fashionable :has() selector.

Let’s upload a brand new motion to the register_actions means like such:

add_action( 'elementor/admin_top_bar/before_enqueue_scripts', [ $this, 'admin_top_bar_css' ] );

Then upload the brand new add_css_to_elementor_admin approach to the ground of the category:

/**
 * Upload inline CSS to switch the Elementor admin peak bar.
 */
public serve as admin_top_bar_css(): void {
	wp_add_inline_style(
		'elementor-admin-top-bar',
		'.e-admin-top-bar__bar-button:has(.eicon-integration){show:none!vital;}'
	);
}

This code leverages the truth that Elementor assigns particular font icons to every peak bar hyperlink, permitting us to focus on the button without delay according to its icon.

Monitoring Referrals Violates the WordPress Plugin Pointers

As of the time this text used to be revealed, Elementor is the usage of cloaked hyperlinks on their Upload-ons web page. So while you hover on a top rate add-on “Let’s cross” button you’re going to see a goal URL that appears one thing like this:

https://cross.elementor.com/{product-slug}/

Whilst you click on and cross to this hyperlink it will redirect you to a referral hyperlink. That could be a contravention of the following plugin guiding principle. As famous in this phase:

Promoting inside the WordPress dashboard will have to be have shyed away from, as it’s in most cases useless…Be mindful: monitoring referrals by the use of the ones commercials isn’t authorized.

To be honest, Elementor does a tight task at disclosing how their Upload-ons web page works on their very own website. However to be absolutely compliant with the WordPress pointers (from my figuring out) they will have to be linking to pages on their website, now not including cloaked hyperlinks without delay within the WP admin.

In case you would additionally like to take away the Get Assist hyperlink you’ll return to our remove_admin_pages means and upload the next on the backside:

remove_submenu_page( 'elementor', 'go_knowledge_base_site' );

Take away the Sidebar Purple Improve Button

Elementor upgrade button

Subsequent we’ll take away the purple improve button that presentations within the admin sidebar beneath the Elementor dad or mum menu merchandise. That is technically an admin web page (when visited it makes use of a redirection to visit their website online) so it may also be got rid of the usage of remove_submenu_page.

Upload the next code within (on the backside) of the remove_admin_pages means.

remove_submenu_page( 'elementor', 'go_elementor_pro' );

The “Improve Now” hyperlink on the peak of Elementor pages is the least intrusive upsell and, individually, is finished in a quite stylish method. Whilst I individually suppose it’s completely applicable, this information is all about serving to you take away as many upsells as imaginable, so I’ll display you methods to do away with it.

In case you are following alongside and you made a decision to cover the add-ons web page you then’ve already added the admin_top_bar_css means for your magnificence. We’ll be updating this approach to additionally conceal the improve now button. If now not, please scroll up and observe the stairs on this phase.

That is what your up to date admin_top_bar_css means will have to seem like:

public serve as admin_top_bar_css(): void {
	$target_icon_classes = [
		'.eicon-integration', // Add-ons
		'.eicon-upgrade-crown', // Upgrade now
	];
	wp_add_inline_style(
		'elementor-admin-top-bar',
		'.e-admin-top-bar__bar-button:has(' . implode( ',', $target_icon_classes ) . '){show:none!vital;}'
	);
}

Take away the Theme Builder

As a unfastened person you received’t have get right of entry to to the Theme Builder. Which is superior by means of the best way, and entirely supported in our General theme. Individually, Theme Builder is the main reason why you will have to acquire the Professional model. It is going to let you in point of fact create a customized website online.

As you most likely guessed, this could also be a “dummy” admin web page just like the purple improve button we got rid of previous. To take away we’ll return to our remove_admin_pages means and upload the next on the backside:

if ( ! isset( $_GET['page'] ) || 'elementor-app' !== $_GET['page'] ) {
    remove_submenu_page( 'edit.php?post_type=elementor_library', 'elementor-app' );
}

We upload an additional take a look at for the the web page question parameter, another way, the Equipment Library will forestall operating.

Elementor theme builder admin bar link

Elementor additionally provides the Theme Builder hyperlink to the person admin bar when logged in and viewing the frontend of your website. Which, once more, should you click on the hyperlink you’re taken to a pointless web page the place you’ll’t do anything else as a unfastened person.

To take away this hyperlink we’ll first wish to upload a brand new motion to our register_actions means:

add_filter( 'elementor/frontend/admin_bar/settings', [ $this, 'modify_admin_bar' ], PHP_INT_MAX );

Then we’ll upload a brand new modify_admin_bar approach to the ground of our magnificence:

/**
 * Regulate the admin bar hyperlinks.
 */
public serve as modify_admin_bar( $admin_bar_config ) {
	if ( isset( $admin_bar_config['elementor_edit_page']['children'] )
		&& is_array( $admin_bar_config['elementor_edit_page']['children'] )
	) {
		foreach ( $admin_bar_config['elementor_edit_page']['children'] as $okay => $merchandise ) {
			if ( isset( $merchandise['id'] ) && 'elementor_app_site_editor' === $merchandise['id'] ) {
				unset( $admin_bar_config['elementor_edit_page']['children'][ $k ] );
				ruin;
			}
		}
	}
	go back $admin_bar_config;
}

Take away the Promo Widgets

Screenshot taken from the full theme Synergy demo.

Elementor additionally comprises the entire top rate widgets within the widget selector, which I perceive so that you could display customers what they’re lacking. Then again, it may be rather irritating when on the lookout for pieces, particularly should you’re the usage of an add-on plugin that registers widgets with equivalent names.

We’re now not technically “taking out” the widgets, so we received’t unlock any reminiscence. Then again, we will be able to conceal them the usage of CSS to wash up and slender down the sidebar.

Let’s upload a brand new motion to our register_actions means:

add_action( 'elementor/editor/after_enqueue_styles', [ $this, 'editor_css' ] );

Then we’ll upload the next approach to the ground of our magnificence:

/**
 * Disguise points within the editor.
 */
public serve as editor_css(): void {
	wp_add_inline_style(
		'elementor-editor',
		'.elementor-element-wrapper.elementor-element--promotion,#elementor-panel-category-pro-elements,#elementor-panel-category-theme-elements,#elementor-panel-category-theme-elements-single,#elementor-panel-category-woocommerce-elements{show:none!vital;}'
	);
}

Take away the Editor Sidebar Banner

As a way to take away the banner from the sidebar within the Elementor widget we’ll use CSS as neatly. We’ll merely replace the former snippet to incorporate a couple of extra points like such:

/**
 * Disguise points within the editor.
 */
public serve as editor_css(): void {
	wp_add_inline_style(
		'elementor-editor',
		'.elementor-element-wrapper.elementor-element--promotion,#elementor-panel-category-pro-elements,#elementor-panel-category-theme-elements,#elementor-panel-category-theme-elements-single,#elementor-panel-category-woocommerce-elements,#elementor-panel-get-pro-elements,#elementor-panel-get-pro-elements-sticky{show:none!vital;}'
	);
}

Take away the Editor Realize Bar

Elementor bottom notice bar

Whilst you first open the Elementor editor, you’ll observe a sticky observe bar on the backside of the web page. As a result of, after all, there can by no means be too many upsells, proper? Whilst you’ll click on the “X” to near it, this received’t forestall it from reappearing later (14 days later).

Let’s return to our editor_css means and replace it to incorporate the e-notice-bar classname. This is the up to date means.

/**
 * Disguise points within the editor.
 */
public serve as editor_css(): void {
	wp_add_inline_style(
		'elementor-editor',
		'.e-notice-bar,.elementor-element-wrapper.elementor-element--promotion,#elementor-panel-category-pro-elements,#elementor-panel-category-theme-elements,#elementor-panel-category-theme-elements-single,#elementor-panel-category-woocommerce-elements,#elementor-panel-get-pro-elements,#elementor-panel-get-pro-elements-sticky{show:none!vital;}'
	);
}

Take away Admin Dashboard Widget

I’m positive a lot of you, like me, don’t spend a lot time at the WordPress “Dashboard” web page. Then again, that is the default web page you’re redirected to while you log into WordPress. Elementor provides a customized widget to the dashboard that presentations a feed from their weblog—and naturally, extra upsell hyperlinks!

Upload the next to the register_actions means:

add_action( 'wp_dashboard_setup', [ $this, 'remove_dashboard_widget' ], PHP_INT_MAX );

Then upload the next approach to the ground of the category:

/**
 * Take away dashboard widget.
 */
public serve as remove_dashboard_widget(): void {
	remove_meta_box( 'e-dashboard-overview', 'dashboard', 'standard' );
}

Ultimate Code & Plugin

In case you adopted alongside you will have to now have a category that appears like this:

/**
 * Take away Elementor Upsells.
 */
magnificence WPEX_Remove_Elementor_Upsells {

	/**
	 * Constructor.
	 */
	public serve as __construct() {
		if ( did_action( 'elementor/loaded' ) ) {
			$this->register_actions();
		} else {
			add_action( 'elementor/loaded', [ $this, 'register_actions' ] );
		}
	}

	/**
	 * Check in our major magnificence movements.
	 */
	public serve as register_actions(): void {
		if ( is_callable( 'ElementorUtils::has_pro' ) && ElementorUtils::has_pro() ) {
			go back; // bail early if we're the usage of Elementor Professional.
		}

		add_action( 'elementor/admin/menu/after_register', [ $this, 'remove_admin_pages' ], PHP_INT_MAX, 2 );
		add_action( 'elementor/admin_top_bar/before_enqueue_scripts', [ $this, 'admin_top_bar_css' ] );
		add_filter( 'elementor/frontend/admin_bar/settings', [ $this, 'modify_admin_bar' ], PHP_INT_MAX );
		add_action( 'elementor/editor/after_enqueue_styles', [ $this, 'editor_css' ] );
		add_action( 'wp_dashboard_setup', [ $this, 'remove_dashboard_widget' ], PHP_INT_MAX );
	}

	/**
	 * Take away admin pages.
	 */
	public serve as remove_admin_pages( $menu_manager, $hooks ): void {
		$pages_to_remove = [];
		$subpages_to_remove = [];
		if ( is_callable( [ $menu_manager, 'get_all' ] ) ) {
			foreach ( (array) $menu_manager->get_all() as $item_slug => $merchandise ) {
				if ( isset( $hooks[ $item_slug ] )
					&& is_object( $merchandise )
					&& ( is_subclass_of( $merchandise, 'ElementorModulesPromotionsAdminMenuItemsBase_Promotion_Item' )
						|| is_subclass_of( $merchandise, 'ElementorModulesPromotionsAdminMenuItemsBase_Promotion_Template' )
						|| 'elementor-apps' === $item_slug
					)
				) {
					$parent_slug = is_callable( [ $item, 'get_parent_slug' ] ) ? $item->get_parent_slug() : '';
					if ( ! empty( $parent_slug ) ) {
						$subpages_to_remove[] = [ $parent_slug, $item_slug ];
					} else {
						$pages_to_remove[] = $hooks[ $item_slug ];
					}
				}
			}
		}
		foreach ( $pages_to_remove as $menu_slug ) {
			remove_menu_page( $menu_slug );
		}
		foreach ( $subpages_to_remove as $subpage ) {
			remove_submenu_page( $subpage[0], $subpage[1] );
		}
		remove_submenu_page( 'elementor', 'go_knowledge_base_site' );
		remove_submenu_page( 'elementor', 'go_elementor_pro' );
		if ( ! isset( $_GET['page'] ) || 'elementor-app' !== $_GET['page'] ) {
			remove_submenu_page( 'edit.php?post_type=elementor_library', 'elementor-app' );
		}
	}

	/**
	 * Upload inline CSS to switch the Elementor admin peak bar.
	 */
	public serve as admin_top_bar_css(): void {
		$target_icon_classes = [
			'.eicon-integration', // Add-ons
			'.eicon-upgrade-crown', // Upgrade now
		];
		wp_add_inline_style(
			'elementor-admin-top-bar',
			'.e-admin-top-bar__bar-button:has(' . implode( ',', $target_icon_classes ) . '){show:none!vital;}'
		);
	}

	/**
	 * Disguise points within the editor.
	 */
	public serve as editor_css(): void {
		wp_add_inline_style(
			'elementor-editor',
			'.e-notice-bar,.elementor-element-wrapper.elementor-element--promotion,#elementor-panel-category-pro-elements,#elementor-panel-category-theme-elements,#elementor-panel-category-theme-elements-single,#elementor-panel-category-woocommerce-elements,#elementor-panel-get-pro-elements,#elementor-panel-get-pro-elements-sticky{show:none!vital;}'
		);
	}

	/**
	 * Take away dashboard widget.
	 */
	public serve as remove_dashboard_widget(): void {
		remove_meta_box( 'e-dashboard-overview', 'dashboard', 'standard' );
	}

}

new WPEX_Remove_Elementor_Upsells;

You’ll reproduction and paste this code into your customized WordPress dad or mum or kid theme purposes.php document or come with it by the use of it’s personal document (really helpful).

On the other hand, I added the code right into a at hand plugin that you’ll obtain from Github and set up to your website. I received’t be importing this plugin to the WordPress repository, so if it ever wishes updating it is important to manually patch it.

Conclusion

If it’s inside of your price range, you will have to head over and buy Elementor Professional (associate hyperlink). Although you don’t want any of the top rate options, should you use Elementor in any respect, it’s excellent to offer again to the builders and lend a hand make stronger the product.

Did I Pass over Anything else? Which Plugin is Subsequent?

If there’s a plugin you’re the usage of that bombards you with commercials and promos, point out me @wpexplorer (on X/Twitter). If the plugin is widespread sufficient I would possibly believe writing as equivalent information for that one subsequent.

Or if I neglected anything else in Elementor let me know!

The submit The Entire Information to Taking away Elementor Upsells seemed first on WPExplorer.

WP Care Plans

[ continue ]