Helpful Code Snippets for WordPress

A selection of PHP and HTML Code Snippets I find helpful when building WordPress websites.

I’ll assume, if you’ve found your way here, you already know what you are doing (to some degree) in WordPress.

If you don’t already have the Code Snippets (or similar) plugin installed, I strongly suggest you install it now. It is far more efficient – and safer – than editing the functions.php file or adding HTML tags into the footer or header of your website.

Remove the annoying 'use AI' recommendation symbol in Elementor page builder

I’ve found this ‘addition’ to Elementor particularly annoying; let alone having to explain it to a client. The fact you need to signup to a service to use it, even if you receive a certain amount of AI content for free, is not something I want to do, nor impose on a client.

To make it go away, add this snippet of PHP code (using Code Snippets – see above), set it to run on either the Entire site or Admin only and presto, the icon is gone. Ideally, it would be better if Elementor offered a setting to turn the function (bloatware) off altogether.

				
					 // Remove AI.

add_action('elementor/editor/before_enqueue_scripts', function () {

echo "<style>";

echo ".e-ai-button {display: none;}";

echo "</style>";

});