How To Prevent WordPress from Applying wpautop to a Page or Post

Published Date Author: , Posted November 19th, 2019 at 1:56:03pm

All credit to Graham Walters for this excellent plugin and post, upon which this post is based – thank you, sir!
https://grahamwalters.me/lab/disable-wpautop-on-specific-postspages/

Recently, a client was having problems using a plugin called by a shortcode. As it turned out, the JavaScript embedded in the returned content was being broken by the WordPress auto-paragraph feature known as wpautop.

Thank to a bit of research, I found the following solution, recorded here in case the original blog post becomes unavailable.

  1. Create the file wp-content/plugins/disable-wpautop/disable_wpautop.php based on the code below the procedure.
  2. WordPress » Admin » Plugins » Activate “Disable wpautop”
  3. Go to the page or post to disable the auto-paragraph feature on
  4. If the Screen Options tool is not visible below, locate the Screen Options button in the upper right corner, open it and check the box labeled Custom Fields.
  5. Locate the Custom Fields tool box below, and inside of it the header “Add New Custom Field:”, and under that click on “Enter New”.
  6. Enter wpautop as the Name, and false as the Value, then click the “Add Custom Field” button.
  7. Click the ‘Update’ button to save the settings.

wp-content/plugins/disable-wpautop/disable_wpautop.php:

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.