Some times coders or WordPressers need to run a PHP code in their site to but pure WordPress does not support running PHP codes.
But Insert PHP plugin will help you running any PHP code within your blog page or post simply by inserting your PHP code in the post or page body without modifying any file and does not need any coding skills. Just copy and paste PHP code!
Insert PHP WordPress Plugin
With Insert PHP plugin, WordPress will run any embedded PHP code quickly and without any problem. So WordPress simply can do pretty much anything PHP could do if it was embedded in the PHP templates.
Another good feature in Insert PHP plugin is the plugin code itself; the code is short, less than 30 lines, and all in one file for quick loading and running, so it will not slow your site loading.
Installing Insert PHP plugin
WordPress plugin installation is pretty simple and straightforward.
You can download the plugin zip file and upload it to WordPress or you can install free plugins from within WordPress dashboard.
Manually Install The Plugin
- Download Insert PHP plugin from WordPress.org’s Plugin page
- Go to WordPress Admin Panel → Plugins → Add New → Upload Plugin [top left].
- Click “Browse” or “choose file” → select the Plugin archive which you have downloaded in step #1 → click “Install Now”.
- Wait for the file to be uploaded and then click “activate plugin”.
Automatic Installation
- Go to WordPress Admin Panel → Plugins → Add New.
- In the search area type “Insert PHP” and click Enter.
- In the search results choose the plugin called “Insert PHP” and click “Install Now”.
- Wait for the file to be downloaded to your host and then click “activate plugin”.
Using Insert PHP plugin
Insert PHP is very simple and easy to use.
To use it, just paste the PHP code into WordPress visual editor and then replace the opening PHP tag <?php
with [insert_php]
and replace the closing ?>
tag with [/insert_php]
in your PHP code and you’re good to go.
It can be that simple!
Looking for php 7 hosting?
read this: Best PHP 7 Hosting providers compared
When you may want to use Insert PHP?
- You can use Insert PHP to Publish local time (users’ computer clock settings being unreliable).
- Also, you can use it to Insert output of a PHP script, or just to run a script whether or not it generates output.
- Check/manipulate cookies or other actions that JavaScript can accomplish when using JavaScript is undesirable.
You can use it to run any PHP code in WordPress posts and pages, so there is no limit to what you can do with it!
Jennifer Lee says
Thank you, Insert PHP was just what we were looking for!
ahmed musleh says
Thanks 👍
Steven says
What a great plugin, Now I can add more scripts to my website and extend the functionality of my WordPress site without having to create a separate PHP files, I can now just create a new page and add the PHP code in it and it will be executed.
Thanks!