Title: [Plugin: Allow PHP in posts] WP auto-formatting and PHP
Last modified: August 21, 2016

---

# [Plugin: Allow PHP in posts] WP auto-formatting and PHP

 *  [Cosine Tau](https://wordpress.org/support/users/taucosine/)
 * (@taucosine)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-wp-auto-formatting-and-php/)
 * Greetings WordPress hackers and gurus!
 * I am writing some custom PHP scripts for a client who would like it displayed
   on a WordPress page. On their WordPress installation, I’ve installed the plugin
   Allow PHP in posts.
 * The PHP script in question does what most code does: queries a table from a database,
   plays with the result and prints it in a orderly fashion. It also uses some JavaScript
   as to access the Google Maps API and display a map.
 * WordPress’ auto formatting often adds unnecessary paragraph (p) and line break(
   br) tags to the text. While this isn’t very problematic to regular text that 
   needs to be read, it is causing syntactical errors in the JavaScript portion.(
   I have the JavaScript being ‘displayed’ by a PHP echo to minimize the amount 
   of times its executed, and to ensure the correct variables are always called.)
 * I have already disabled WordPress’ auto formatting in the theme’s functions.php
   file, I have include()’d WordPress’ API in the script and disabled the auto formatting
   there too, as well as tried a few anti-autoformatting plugins (often requiring
   the use of a custom field) but have not gotten the predicted results.
 * The code is being executed by the Allow PHP in posts (using eval() ) but the 
   raw code does not exist in the post, but rather is being include()’d in the post.
 * Does anyone have any suggestions as to disable WP from auto formatting that text?

The topic ‘[Plugin: Allow PHP in posts] WP auto-formatting and PHP’ is closed to
new replies.

## Tags

 * [Auto-format](https://wordpress.org/support/topic-tag/auto-format/)
 * [autoformat](https://wordpress.org/support/topic-tag/autoformat/)
 * [autoformatting](https://wordpress.org/support/topic-tag/autoformatting/)
 * [wpautop](https://wordpress.org/support/topic-tag/wpautop/)

 * 0 replies
 * 1 participant
 * Last reply from: [Cosine Tau](https://wordpress.org/support/users/taucosine/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-wp-auto-formatting-and-php/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
