Allow PHP in Posts and Pages WordPress Plugin

Allow PHP in posts and pages adds the functionality to include PHP in your WordPress posts and pages by adding a shortcode [php] your code [/php] the coding is very most popular, why coding is popular, because many websites using the coding as per the PHP, HTML, CSS, If anybody wanted to without any write like a content without any skills just getting the money, has been ideas in this on Coding.

I’m sharing the plugin with yours, Finally, I get the inside plugin to working on your website with any posts,

This plugin attempts to strip away the automatically generated WordPress <p> and <br/> tags but still allows the addition of your own <p> and <br/> tags using a form of BBcode items such [p][/p] and [br /]

You can also save your most used bits of code as snippets for use across multiple pages.

With Version 2.2, the older tag replacement system has been revamped, hopefully reducing the need to escape some characters for example: [ and ] that shouldn’t be changed < and >

With Version 2.3 comes an experimental advanced filter feature which allows you to use standard PHP code while taking advantages of variables throughout the entire post content, and functions, as well as no pesky tag replacement.

With Version 3 comes entirely re-written code with support for code snippets being used in conjunction with the advanced filter feature as well as a class variable to share variables between saved snippets and code blocks. This version also comes with UI updates.

How To Allow PHP Posts and Pages

Before you get this plugin as per your website and install now with active. The PHP coding post using now. Allow PHP in Posts and Pages, Here a link,

Here some steps show below listed

  1. Install the plugin
  2. Click to active button


Using the plugin couldn’t be simpler; the plugin has 2 variants of shortcode available, [php] and [allowphp] other versions of the shortcode may exist but are not fully supported.

To add the PHP code to your post or page simply place any PHP code inside the shortcode tags as follows:

Here the code.

    global $user_ID;
    if($user_ID == 1){
        echo "Hello World";
This code will output Hello World to only user id #1, and no one else

The shortcode can take some additional attributes to assist with PHP writing

  • “debug” – [1/0] – Turns on error reporting and display errors for snippets
  • “silent debut” – [1/0] – When used with “debug” shows errors in the source code only
  • “mode” – [“old”/”new] – Maintained for backwards compatibility only – When set to “old” enables the pre version 2.2.0 code replacement system for that shortcode, when set to “new” with the preparse option enabled it uses the newer code replacement system for that shortcode

You’re Done, you have learnt a very great lesson today on how to use PHP within posts and pages in a WordPress blog. Good Luck.


In addition to these attributes, a new one has been added called “function”. The function attribute allows the addition of user defined code snippets into the content. The shortcode for snippets is [php function=x] or [allowphp function=x]

To integrate the snippets with the advanced filter, the shortcode should not contain any additional attributes or spaces

Code snippets can be added in the plugin’s options page and can be re-used on as many pages as you like

Leave a Comment