Posted On April 6, 2019

How to Disable WordPress Auto Wrap Function ‘wpautp’

kimconnect 0 comments
blog.KimConnect.com >> Codes >> How to Disable WordPress Auto Wrap Function ‘wpautp’

Update: the current version of WordPress has rendered these methods ineffective. I’ll update this post once a working solution is discovered.

WordPress has this function called ‘wpautop’ that would add <p> tags as wrapper to <script> tags. Hence, it may be necessary to play .js by disabling wpauto such as:

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

At more flexible solution is to use a WordPress plugin such as “wpautop control” contributed by the Dev named @bigsmoke on WordPress.org

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: File Copy Script using EmCopy & VSS (Legacy)

The script below is for informational purposes. Here is a better version <#.Description FileCopyScript_v1.1.8.ps1 Note: this…

Add Local Windows User

# Dynamic Credential$who = whoamiif ($who.substring($who.length-2, 2) -eq "-admin"){$username=$who;}else {$username=$who+"-admin";}$password = Read-Host -Prompt "Input the…

PowerShell: Error when Pause is Placed Inside Function

Error: + Function Search-ScheduledTasks{+ ~Missing closing '}' in statement block or type definition.At C:\Users\kdoan\Desktop\Notes\test.ps1:57 char:1+…