WordPress Plugins To Run PHP Codes inside Post and Page

Sometimes we may need to execute some PHP codes inside a post on a WordPress website. I have found these two very useful WordPress plugins to run / execute PHP codes inside any post / pages / widget on a WordPress website.

  1. Exec-PHP
  2. Insert PHP

Exec-PHP

The Exec-PHP plugin executes PHP code in posts, pages and text widgets. You can also restrict execution of PHP code in posts and pages to certain users by using roles and capabilities.

How to use Exec-PHP plugin

  1. Install and activate the the plugin.
  2. Put php codes as you normally write.

Example:

<?php
  // Your PHP codes here
?>

Insert PHP

You can insert and run PHP codes into WordPress posts and pages using this plugin. The plugin creates a shortcode [insert_php]. Just place your php codes within this shortcode.

How to use Insert PHP plugin

  1. Install and activate the the plugin.
  2. Put PHP codes inside shortcode [insert_php] and [/insert_php] and do not use php syntax.

Example:

 [insert_php]
  echo "Hello Gelcode.com";
[/insert_php]