AI Summary
Would you like a simple, one-click way to add custom code snippets to your site? With WP Mail SMTP and the WPCode plugin, you can install ready-made code snippets without editing your theme’s functions.php file.
In this tutorial, we’ll show you how to use WP Mail SMTP code snippets to extend your setup with just a few clicks.
Requirements: The built-in Code Snippets library requires WP Mail SMTP 4.9 or later.
Getting Started With WPCode
WP Mail SMTP code snippets are powered by WPCode, a free plugin for managing custom code. To find them, go to WP Mail SMTP » Tools and open the Code Snippets tab.


This page lists the full library of WP Mail SMTP snippets, each with a title and a short description of what it does. You can scroll through the list or use the Search Snippets box to find one quickly. Once you find the one you’d like to use, click Install Snippet.


The first time you install a snippet, WP Mail SMTP prompts you to install and activate the WPCode plugin. Go ahead and click Install & Activate WPCode to add the free plugin that powers the library.


Adding WP Mail SMTP Code Snippets
Browse or search the library to find the snippet you need. Each entry shows a title and a short description, so you know exactly what the snippet does before you add it. To preview a snippet’s code first, click View.


When you’re ready, click the Install Snippet button for the snippet you want.


WP Mail SMTP installs it and opens the snippet in WPCode, where you’ll see the code, the insertion settings, and the conditional logic.
By default, the snippet runs everywhere on your site, so you don’t need to change the insertion settings.


To activate the snippet, toggle the Active option on, then click Update to apply it to your site.


Editing or Deleting a Code Snippet
Editing a Code Snippet
To change a snippet you’ve already installed, return to the Code Snippets tab and click Edit Snippet on the snippet you want to adjust.


This opens it in WPCode, where you can update the code or settings and click Update to save your changes.


Deleting a Code Snippet
To remove a snippet, go to Code Snippets » Code Snippets in your WordPress sidebar. Hover over the snippet you want to remove and click Trash.


That’s it! Now you know how to use WP Mail SMTP code snippets to extend your setup with WPCode, all without touching your theme files.
Next, explore our code snippet tutorials for more ways to customize WP Mail SMTP.