---
title: "How to Add Custom Code Snippets Using a Third-Party Plugin"
description: "This article explains how to add a custom code snippet to a WordPress website using third-party plugins like Code Snippets."
author: "Sanjai Valsan"
published_date: 2023-08-23
modified_date: 2026-07-12
canonical_url: "https://www.webtoffee.com/docs/how-tos/add-custom-code-snippets-third-party-plugins/"
source: "https://www.webtoffee.com"
reading_time: 2 min
word_count: 376
categories:
  - "Documentation"
  - "Getting Started"
  - "How to"
---

## Summary

This article explains how to add a custom code snippet to a WordPress website using third-party plugins like Code Snippets.

## Breadcrumb

[Home](https://www.webtoffee.com/) > [Documentation](https://www.webtoffee.com/category/documentation/) > [How to](https://www.webtoffee.com/category/documentation/how-tos/) > How to Add Custom Code Snippets Using a Third-Party Plugin

# How to Add Custom Code Snippets Using a Third-Party Plugin

*Last updated on July 12, 2026*

Adding custom code snippets is one of the most powerful ways to enhance or extend a plugin’s functionality. One of the easiest and safest ways to add custom code snippets is by using third-party plugins. This article discusses how to add a custom code snippet using the [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin.

## Code Snippets

The Code Snippets plugin is a powerful tool that helps add custom code snippets to a WordPress website without modifying the theme’s files directly, thereby reducing the risk of compatibility issues and making updates smoother. To add a custom code using the Code Snippets plugin, follow these basic steps:

- Install and activate the [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin.
- On installation, a Snippets icon will appear on the WordPress dashboard.

- From the WordPress dashboard, navigate to Snippets > Add New
- In the Add New Snippet window, type in a suitable Title, Code, Description, and Tags in the space provided.- Make sure that the Functions (PHP) tab is active.

![Add New Snippet](https://www.webtoffee.com/wp-content/uploads/2023/08/add-new-snippets-1-1024x797.jpg)
*caption: Add New Snippet*

- Select the location to run the code snippet from the four options available.
- Run snippet everywhere: Executes the code throughout the site.
- Only run in administration area: Executes the code within the WordPress admin dashboard.
- Only run on site front-end: Executes the code only on the public-facing part of the website.
- Only run once: Executes the code only once.

![Select the desired area to run the snippet](https://www.webtoffee.com/wp-content/uploads/2023/10/code-snippet-where-to-run-the-code-1024x51.jpg)
*caption: Select the desired area to run the snippet*

- Click on Save Changes and Activate to save and activate the code snippet.

![Save Changes and Activate](https://www.webtoffee.com/wp-content/uploads/2023/08/save-changes-in-code-snippets-1-1024x132.jpg)
*caption: Save Changes and Activate*

## Example

So, let’s take an example of adding a custom code to alter the font size in a [WooCommerce Address label](https://www.webtoffee.com/product/woocommerce-address-label/).

- As an initial step, enter the title, code, description, and tags in the space provided, as shown below.- Make sure the Functions (PHP) tab is active.

![Custom code snippet for altering font size](https://www.webtoffee.com/wp-content/uploads/2023/08/code-snippets-plugin-2-1024x803.jpg)
*caption: Custom code snippet for altering font size*

- Then, select the desired area to run the snippet.

![Select the desired area to run the snippet](https://www.webtoffee.com/wp-content/uploads/2023/10/code-snippet-where-to-run-the-code-1024x51.jpg)
*caption: Select the desired area to run the snippet*

- As a final step, click on Save Changes and Activate to save and activate the snippet.

## Managing code snippets

- To view and manage the snippets, navigate to Snippets > All Snippets.
- One can view, edit, clone, export, and delete snippets under the All Snippets tab.

![All snippets page](https://www.webtoffee.com/wp-content/uploads/2023/08/all-snippets-1-1-1024x450.jpg)
*caption: All Snippets page*## About the Author

[Sanjai Valsan](https://www.webtoffee.com/author/sanjai/)

Technical Content Writer at WebToffee, simplifying complex concepts for seamless user experiences.

## Documentation Navigation

- [Getting Started](#getting-started-how-tos)- [How to Install a Free Plugin fro...](https://www.webtoffee.com/docs/how-tos/installation-guide-wordpress-free-plugin/)
- [Add Custom Codes Using Third Party Plugins](https://www.webtoffee.com/docs/how-tos/add-custom-code-snippets-third-party-plugins/)