Title: PHP code in table description
Last modified: October 5, 2021

---

# PHP code in table description

 *  Resolved [pauldotmac](https://wordpress.org/support/users/pauldotmac/)
 * (@pauldotmac)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/php-code-in-table-description/)
 * Hi,
 * Is it possible to insert php code in the description part of the table for a 
   tablepress table? I tried it and couldn’t get it to work. I inserted <?php echo(“
   Hello World”) ?> and it got converted to <!–?php echo (“Hello World”) ?–>
 * Thanks
 * Paul
 * Great plugin BTW

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/php-code-in-table-description/#post-14940853)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * No, this is not possible, by default, for security reasons.
    I would recommend
   to instead maybe use a custom Shortcode that “wraps” your PHP code, which you
   can then use in the post/page where you are showing the table.
 * Out of curiosity: What are you planning to do with that PHP code?
 * Regards,
    Tobias
 *  Thread Starter [pauldotmac](https://wordpress.org/support/users/pauldotmac/)
 * (@pauldotmac)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/php-code-in-table-description/#post-14941012)
 * The description field includes a link to an external php file that generates 
   a pdf document. Some people seem to be having caching issues with the version
   of the pdf file that gets generated so I thought I might add a random value pair
   to the query string to make sure the correct latest version of the pdf file gets
   generated. About the time you posted it occurred to me that maybe I could do 
   it with a shortcode.
 * Thanks for the quick reply.
 * Thanks
 * Paul
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/php-code-in-table-description/#post-14941055)
 * Hi Paul,
 * ah, ok. Interesting problem… PHP could indeed solve this, but a Shortcode would
   really be better. Good to hear that this helped! 🙂
 * Best wishes,
    Tobias   P.S.: In case you haven’t, please rate TablePress [here](https://wordpress.org/support/plugin/tablepress/reviews/#new-post)
   in the plugin directory. Thanks!

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

The topic ‘PHP code in table description’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/php-code-in-table-description/#post-14941055)
 * Status: resolved