Title: Enable PHP for own HTML in widget
Last modified: August 21, 2016

---

# Enable PHP for own HTML in widget

 *  Resolved [mdidesign](https://wordpress.org/support/users/mdidesign/)
 * (@mdidesign)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/enable-php-for-own-html-in-widget/)
 * Hey,
 * is there a way to enable PHP within the widget, when using own HTML? Would be
   really nice – it is already possible for the usual TEXT-widget of WordPress –
   how about enabling it for this plugin, too?
 * Regards
 * [https://wordpress.org/plugins/wordpress-popular-posts/](https://wordpress.org/plugins/wordpress-popular-posts/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/enable-php-for-own-html-in-widget/#post-4960301)
 * Hi there,
 * No, that can’t be done since the WPP widget can’t parse PHP functions / scripts–
   and I won’t add such a feature because: 1. it’ll make things overly complicated,
   and 2. because you already can do something like [this](http://wordpress.org/support/topic/first-thumbnail-bigger-with-post-excerpt?replies=14#post-5545209)
   to modify the standard HTML output. With it, you could call PHP functions as 
   well. Make sure you read the entire topic as it contains info that you should
   be aware of.
 *  Thread Starter [mdidesign](https://wordpress.org/support/users/mdidesign/)
 * (@mdidesign)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/enable-php-for-own-html-in-widget/#post-4960302)
 * I decided to use the customized TEXT-widget of WordPress to achieve what I want.
   I am using “wpp_get_mostpopular()” and all those tags together with a shortcode
   which contains all PHP that I need.
 *  Thread Starter [mdidesign](https://wordpress.org/support/users/mdidesign/)
 * (@mdidesign)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/enable-php-for-own-html-in-widget/#post-4960303)
 * By the way: How much does this plugin affect the load time of the website? As
   far as I can see the plugin catches every single view of a post? Does´nt this
   slows down the entire website?
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/enable-php-for-own-html-in-widget/#post-4960368)
 * > As far as I can see the plugin catches every single view of a post?
 * Yep, otherwise how would the plugin track page views?
 * > Does´nt this slows down the entire website?
 * Nope, updating the views count should be fairly quick on most websites.
 *  Thread Starter [mdidesign](https://wordpress.org/support/users/mdidesign/)
 * (@mdidesign)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/enable-php-for-own-html-in-widget/#post-4960370)
 * Yes, thanks for your feedback. Unfortunately all kind of views are counted – 
   I don´t know if it were bots or crawlers but even when no real visitor visited
   my site, I saw that views were counted. There should be something like an intelligent
   filter here – just like in Google Analytics, where those bots are also not counted(
   for at least 90% or so).
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/enable-php-for-own-html-in-widget/#post-4960399)
 * Yep, I’m aware of that. I posted a simple [workaround here](http://wordpress.org/support/topic/spambots-being-the-main-source-of-post-views)
   that should keep most bots out the statistics for the time being until WPP 3.0
   is ready.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Enable PHP for own HTML in widget’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/enable-php-for-own-html-in-widget/#post-4960399)
 * Status: resolved