WordPress Plugins To Execute PHP code in WordPress Sidebar

WordPress text widget lets you add any text including AdSense ads script in the sidebar, but it gets tricky when you have to execute a PHP code in the sidebar. By default WordPress doesn’t execute PHP codes in sidebar, and you need to add codes in theme file to execute it. If you are a coder or a programmer, you can easily do that but if you are non-tech user like me, you will find it hard to do. Here I’m sharing two plugins which will let you save PHP code in blog sidebar and execute it. This is useful when you want to run ads on specific category. Something which widget logic plugin does.

Add php code in WordPress Widget

2 WordPress PHP Widget plugin

PHP code Widget:

This is the first plugin which helps you to add PHP code in the sidebar. When you add the PHP code make sure it’s enclosed in in standard opening and closing tags. You can download the plugin from official page here.

PHP text widget

This is another plugin which let you run PHP codes in your blog sidebar. This plugin works similarly as above plugin and simply  activate the plugin, drag the widget and add your codes. You can download the plugin from here.

For now these two plugins will solve your purpose, in case if you know of any other plugin let me know via comments.

Subscribe on Youtube

Article By
Harsh Agrawal is a blog scientist and a passionate blogger. He is blogging since 2008 & writes about Blogging, SEO, Make money online & tech. His blog, ShoutMeLoud receives 1 million Pageviews/month and have over 700K subscribers.



  1. Scott says

    Hi Harsh

    Does this work with the current version of wp 2.9.2? If so, that would be great and I could use it asap.

    please let me know. Thanks