How To Run PHP Code In Post, Page And Sidebars Widget via Plugins

I remember some months ago i was trying to execute PHP code within a blog post i was crafting. i later abandoned the writing of the article as i couldn’t find a way to run the PHP codes.
Am going to share some plugins to help execute and process PHP codes within WordPress post, pages, and Widget sidebars.
Had it been i knew of these plugins as at that time, that abandoned post would have gone live.

  1. Enable Shortcode and PHP in Text widget

    By default, the Text widget only support text and HTML. With this plugin activated, PHP and shortcode would be supported.
    To execute PHP in text Widget, ensure the PHP code to be executed is encapsulated in between PHP opening and closing tag <?php … ?>

  2. Daiko’s Text Widget

    This plugin adds a text widget that is capable of displaying and executing PHP codes. Conditional tags are included in this plugin to specify where the php code will display.
    To use, install and activate it, drag the Daiko’s Text Widget to your sidebar and add your own content including php code if needed. Optionally specify whether to display only on home, pages, posts, posts in category(-ies) or category archives. Specify even more if you like with slug/ID/title.

  3. PHP Code Widget

    The normal Text widget allows you to insert arbitrary Text and/or HTML code. This allows that too, but also parses any inserted PHP code and executes it. This makes it easier to migrate to a widget-based theme.
    All PHP code must be enclosed in the standard tags for it to be recognized.

  4. Exec-PHP

    The Exec-PHP plugin executes PHP code in posts, pages and text widgets. it has great configurable features such as: Restrict execution of PHP code in posts and pages to certain users by using roles and capabilities; Information about which users are allowed to execute PHP with the current security settings; Executes PHP code in the excerpt and the content portion of your posts and pages; Works in your newsfeeds.
    Visit for plugin documentation/

  5. Shortcode Exec PHP

    Using this plugin you can execute arbitrary PHP code using shortcodes in your posts, pages, comments, widgets and RSS feeds, just like manually defined shortcodes. The shortcodes and associated PHP code are defined using the settings of this plugin. It is possible to parse and use shortcode parameters and to use shortcode content. Defined shortcodes can be deleted and disabled.

  6. WP exec PHP

    This plugin executes PHP inside posts, pages and text widgets. Add filters and actions using custom fields. Use <?php .... ?> to execute PHP.

About Agbonghama Collins

Agbonghama Collins is a webdeveloper and an internet geek. I love writing and sharing the little idea & information i know. Hope you enjoyed my Article.

Follow me on Twitter, add him on Facebook or on Google+