Title: PHP Code in cells
Last modified: May 20, 2024

---

# PHP Code in cells

 *  Resolved [pauldotmac](https://wordpress.org/support/users/pauldotmac/)
 * (@pauldotmac)
 * [2 years ago](https://wordpress.org/support/topic/php-code-in-cells/)
 * Hi, I use an excel spreadsheet to generate some php code in a cell so that when
   it gets imported into Tablepress the desired data is displayed but it seems to
   have stopped working and converted the text into a comment i.e.
 *     ```wp-block-code
       <td class="column-5"><!--?php echo date("jS M y", 1717545600)  ?--><br><!--?php echo date("jS M y", 1718150400)  ?--><br><!--?php echo date("jS M y", 1718755200)  ?--><br><!--?php echo date("jS M y", 1719360000)  ?--><br><!--?php echo date("jS M y", 1719964800)  ?--></td>
       ```
   
 * It used to work, has there been an update that now prevents it?
 * Thanks
 * Paul
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-code-in-cells%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years ago](https://wordpress.org/support/topic/php-code-in-cells/#post-17769558)
 * Hi!
 * Thanks for your post and sorry for the trouble!
 * By default, TablePress does not evaluate PHP code in table cells. There used 
   to be a TablePress Extension that made this possible, but due security concerns,
   that is no longer available.
 * Now, I’m not sure why your current PHP code is being replaced with HTML comments
   though… TablePress does not do that, and I’m not aware of a functionality in 
   WordPress that would be doing that either…
 * Anyways, the best approach here might be to develop a custom Shortcode that then
   evaluates your PHP code (with it being able to be influenced by the user) and
   returns the desired dates. Alternatively, you could maybe also simply create 
   the desired date format in Excel, either statically or via formula.
 * Best wishes,
   Tobias

Viewing 1 replies (of 1 total)

The topic ‘PHP Code in cells’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/php-code-in-cells/#post-17769558)
 * Status: resolved