Advertise Here

All the information to eliminate Elementor upsells

by | Jan 16, 2025 | Etcetera, wordpress maintenance, wordpress seo | 0 comments


Elementor is a powerful wordpress website builder software, however its dashboard can sometimes seem really cluttered with upsell ads and triggers for tip rate choices.

In this data, I’ll show you techniques to remove most of Elementor’s upsells, allowing you to enjoy a cleaner, more centered interface. You will apply the suggestions and add the code to your custom designed theme, otherwise you will skip the suggestions and alternatively acquire the handy plugin on Github.

Quicker than we dive in, it’s worth mentioning that the simplest approach to removing Elementor upsells is to purchase and install Elementor Professional (affiliate link). This is what I like to suggest, on the other hand, not everyone needs extra choices or may not be able to make a decision on the current value.

This knowledge may also be questionable, but again correct, here is my view: While I completely understand the need to generate profits, I believe that while creating a free LPG product, buyers should have the freedom to change it as they deem compatible.

Once again, I highly recommend you purchase Elementor Skilled to gain admission to tons of great choices and empower developers. Check out the Elementor Unfastened vs Professional article on their webpage to see what you might be missing too!

For those who are unable to adapt to the professional fashion and prefer to stick with the free one, continue to find out how to remove upsells for a cleaner individual interface.

TL;DR Move on to the final code and plugin

WPEX_Remove_Elementor_Upsells PHP class

Let’s start with the use of increasing our PHP elegance which is able to retain all the essential code to remove Elementor upsells. This will keep everything neat and structured. At the top of the class, we’ll include a check to make sure that should you toughen up with Elementor Skilled, now nothing else will be removed or affected.

This is our initial elegance:

/**
 * Remove Elementor Upsells.
 */
elegance WPEX_Remove_Elementor_Upsells {

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

	/**
	 * Test in our main elegance actions.
	 */
	public function register_actions(): void {
		if ( is_callable( 'ElementorUtils::has_pro' ) && ElementorUtils::has_pro() ) {
			return; // bail early if we are using Elementor Skilled.
		}

		// We will be able to do problems proper right here...
	}
	
}

new WPEX_Remove_Elementor_Upsells;

In the rest of this tutorial, we will be together with the new code inside this elegance. You need to watch in moderation, as skipping any section may make you forget the most important code. Then again, you will move on to the beginning and replicate all the final fashion of the lesson.

Elementor records a reasonably large number of admin pages that really do nothing more than display a landing web page to reinforce the professional style. First we will remove the following useless pages:

  • Presentations
  • Custom designed fonts
  • Custom designed icons
  • Custom designed code
  • Add-ons (bonuses)

We’ll start by updating ours register_actions the technique seems to be this:

/**
 * Test in our main elegance actions.
 */
public function register_actions(): void {
	if ( is_callable( 'ElementorUtils::has_pro' ) && ElementorUtils::has_pro() ) {
		return; // bail early if we are using Elementor Skilled.
	}

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

Then we will add a completely new approach called remove_admin_pages to the class that is able to look like this:

/**
 * Remove admin pages.
 */
public function 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 => $products ) {
			if ( isset( $hooks[ $item_slug ] )
				&& is_object( $products )
				&& ( is_subclass_of( $products, 'ElementorModulesPromotionsAdminMenuItemsBase_Promotion_Item' )
					|| is_subclass_of( $products, '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 hook takes advantage of a handy hook throughout the Elementor plugin, so we will dynamically get a list of promotional admin pages and remove them.

Remove the Add-ons Internet web page

You may find the Add-ons panel useful as it is a way to find Elementor-compatible plugins that provide additional capability. On the other hand, most of these are flagship rate add-ons (aka ads) and if you are not purchasing Elementor Skilled, you will almost certainly not buy anything each from this web page.

To remove Internet web page add-ons we will change the previous technique to have additional control like this:

/**
 * Remove admin pages.
 */
public function 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 => $products ) {
			if ( isset( $hooks[ $item_slug ] )
				&& is_object( $products )
				&& ( is_subclass_of( $products, 'ElementorModulesPromotionsAdminMenuItemsBase_Promotion_Item' )
					|| is_subclass_of( $products, '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 was add once || 'elementor-apps' === $item_slug to the if observation.

Link to Elementor top bar admin addons

If you have had your add-ons web page deleted, you will also need to remove the link in the top bar of Elementor. Otherwise, if someone clicks on the link, they will be taken to a wordpress error web page with the warning “Sorry, you are not allowed to access this web page.”

To simplify matters, what we’ll do is add just a bit of custom designed CSS in the WP admin that hides the link using the nifty :has() selector.

Let’s add a completely new movement to the register_actions approach like this:

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

Then add the new one add_css_to_elementor_admin technique to the bottom of the class:

/**
 * Add inline CSS to change the Elementor admin top bar.
 */
public function admin_top_bar_css(): void {
	wp_add_inline_style(
		'elementor-admin-top-bar',
		'.e-admin-top-bar__bar-button:has(.eicon-integration){display:none!necessary;}'
	);
}

This code takes advantage of the fact that Elementor assigns explicit character icons to each top bar link, allowing us to immediately focus on the button along with its icon.

wordpress-plugin-guidelines”>wordpress-plugin-tips”/>Referral tracking violates wordpress plugin suggestions

At the time of printing this article, Elementor uses hidden links on the add-ons web page. So, as you hover over the “Let’s Move” button of a flagship fare add-on, you’ll see a feature URL that looks like this:

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

When you click and go to this link, we will redirect you to a referral link. This may constitute a violation of the following plugin guiding principle. As I know at this stage:

Selling within the wordpress dashboard should be avoided, as it is generally useless… Please note: Referral tracking via such ads is not licensed.

To be fair, Elementor does a decent job of revealing how web page loading works on your web page. On the other hand, to be fully compliant with wordpress guidelines (from my work), they should link to pages on their web page, not along with hidden links at the same time in the WP admin.

For those who would also like to remove the Get help link you will return to our remove_admin_pages come closer and add the following below:

remove_submenu_page( 'elementor', 'go_knowledge_base_site' );
Elementor refresh button

Next we will remove the crimson boost button that appears in the admin sidebar under the Mom or Dad Elementor menu products. This is technically an admin Internet web page (when visited it uses a redirect to go to their website), so it will also be removed using remove_submenu_page.

Add the following code inside (at the bottom) of the file remove_admin_pages approach.

remove_submenu_page( 'elementor', 'go_elementor_pro' );

The “Reinforce Now” link at the top of Elementor pages is the least intrusive upsell and, in my opinion, is completed with a reasonably trendy approach. While I assume this is completely acceptable in my opinion, this knowledge is to help you eliminate as many upsells as possible, so I’ll show you how to get rid of them.

If you are following along and have decided to hide the add-ons web page, you have surely already added the admin_top_bar_css get closer to your elegance. We will update this technique to additionally hide the file harden now button. If not, scroll up and apply the steps in this section.

This is what you are doing at the moment admin_top_bar_css the approach should be as follows:

public function 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 ) . '){display:none!necessary;}'
	);
}

Remove Theme Builder

As a free individual you will not have access to the Theme Builder. Which is great thanks to the use of the simplest and fully supported way in our overall theme. Personally, Theme Builder is the main reason why you will need to acquire the Able style. It will allow you to truly create a custom-designed website.

As you’ve probably guessed, this is also a “dummy” admin page identical to the crimson boost button we removed earlier. To remove we will return to our remove_admin_pages come closer and add the following below:

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

Let’s add an additional check for the query parameter of the Internet Web page, otherwise the Apparatus Library will stop working.

Elementor theme builder admin bar link

Elementor also provides Theme Builder link to individual admin bar when you log in and view the frontend of your webpage. Which, once again, you have to click on the link that takes you to a useless web page where you will do nothing as a free individual.

To remove this link, we will first need to add a completely new movement to ours register_actions approach:

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

Then we’ll add a brand new one modify_admin_bar technique to the very depths of our elegance:

/**
 * Keep watch over the admin bar links.
 */
public function 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 $k => $products ) {
			if ( isset( $products['id'] ) && 'elementor_app_site_editor' === $products['id'] ) {
				unset( $admin_bar_config['elementor_edit_page']['children'][ $k ] );
				break;
			}
		}
	}
	return $admin_bar_config;
}
Screenshot from the full Synergy theme demo.

Elementor also embeds all of the peak price widgets in the widget picker, which I understand is with the intention of showing shoppers what they’re missing. On the other hand, it can be a little frustrating when searching for items, especially if you use an additional plugin that registers widgets with identical names.

We’re technically not “resending” the widgets, so we won’t be freeing up memory. On the other hand, we will hide them using CSS to clean up and narrow the sidebar.

Let’s add a completely new movement to ours register_actions approach:

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

So we will add the following technique to the bottom of our elegance:

/**
 * Conceal issues throughout the editor.
 */
public function 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{display:none!necessary;}'
	);
}

To remove the banner from the sidebar of the Elementor widget we will use CSS just as smartly. We’ll simply edit the previous snippet to include some additional issues like these:

/**
 * Conceal issues throughout the editor.
 */
public function 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{display:none!necessary;}'
	);
}

Remove editor warning bar

Elementor bottom warning bar

When you first open the Elementor editor, you’ll apply a sticky application bar at the bottom of the webpage. Because, there certainly can’t be too many upsells anyway, right? When you click the “X” to close it, this will not prevent it from reappearing later (14 days later).

Let’s go back to our editor_css approach e change to include the electronic alert bar class name. This is the current approach.

/**
 * Conceal issues throughout the editor.
 */
public function 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{display:none!necessary;}'
	);
}

I’m sure many of you, like me, don’t spend that much time on the wordpress “Dashboard” internet page. On the other hand, this is the default Internet web page that you are redirected to when you log in to wordpress. Elementor provides a custom widget to the dashboard that displays a feed from their blog and of course, additional upsell links!

Add the following to the register_actions approach:

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

Then add the following technique to the bottom of the class:

/**
 * Remove dashboard widget.
 */
public function remove_dashboard_widget(): void {
	remove_meta_box( 'e-dashboard-overview', 'dashboard', 'usual' );
}

Final code and plugins

For those who have been following along, you will now need to have a class that looks like this:

/**
 * Remove Elementor Upsells.
 */
elegance WPEX_Remove_Elementor_Upsells {

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

	/**
	 * Test in our main elegance actions.
	 */
	public function register_actions(): void {
		if ( is_callable( 'ElementorUtils::has_pro' ) && ElementorUtils::has_pro() ) {
			return; // bail early if we are using Elementor Skilled.
		}

		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 );
	}

	/**
	 * Remove admin pages.
	 */
	public function 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 => $products ) {
				if ( isset( $hooks[ $item_slug ] )
					&& is_object( $products )
					&& ( is_subclass_of( $products, 'ElementorModulesPromotionsAdminMenuItemsBase_Promotion_Item' )
						|| is_subclass_of( $products, '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' );
		}
	}

	/**
	 * Add inline CSS to change the Elementor admin top bar.
	 */
	public function 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 ) . '){display:none!necessary;}'
		);
	}

	/**
	 * Conceal issues throughout the editor.
	 */
	public function 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{display:none!necessary;}'
		);
	}

	/**
	 * Remove dashboard widget.
	 */
	public function remove_dashboard_widget(): void {
		remove_meta_box( 'e-dashboard-overview', 'dashboard', 'usual' );
	}

}

new WPEX_Remove_Elementor_Upsells;

You will copy and paste this code into your custom wordpress theme Functions.php report for mom or dad or baby or include it via its private report (really useful).

Then again, I’ve added the actual code into a handy plugin that you can download from Github and set up as much as your own web page. I will not be uploading this plugin to the wordpress repository, so if you ever need to update it it is very important to patch it manually.

Conclusion

If it is within your price range, you will have to go and purchase Elementor Professional (affiliate link). Even if you don’t need any of the higher paid choices, if you use Elementor at least a little, it is very useful to once again provide the developers and have the same opinion to strengthen the product.

Did I review something? Which plugin is next?

If you’re using a plugin that bombards you with ads and promotions, tell me @wpexplorer (on X/Twitter). If the plugin is common enough, maybe I would imagine writing as identical data for the next one.

Or, if I overlooked something in Elementor, let me know!

The post All the information to remove Elementor upsells appeared first on WPExplorer.

WP Service Plans

[ continue ]

wordpress Maintenance Plans | wordpress hosting

Read more



Source link

thatguy
Author: thatguy

Places

Services

  • No Categories

Classifieds

  • No Categories

Events

News

Shopping