Here is the easy way to add PHP code to WordPress

Wilfred Chong
3 min readMay 23, 2023

Want to add custom PHP code to your WordPress site? It’s simpler than you think with the WP Code plugin. Let’s dive straight into the steps to get you started.

Step 1: Installing WP Code

Install and activate the WP Code plugin.

WP Code is a phenomenal tool that supports custom PHP, JavaScript, CSS, HTML, Text, and other custom code snippets.

It can automatically run your code site-wide or in specific locations like before post content, in the header, or even the footer.

To add WP Code to your site, navigate to the Plugins section on your WordPress dashboard and search for “WP Code”.

Step 2: Adding Your Custom Code

Now that you’ve got WP Code up and running, it’s time to add your custom PHP code.

From your WordPress dashboard, hover over WP Code, then click ‘Add New’.

You’ll be taken to a new page where you can start writing your custom code.

Once you’re on this page, look for an option titled “Add Your Custom Code(New Snippet)”.

Select it, and then choose the code type to PHP in the dropdown that appears.

--

--