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: Adding Active Directory Module

Windows environments often are controlled by Active Directory; hence, it is useful to include this…

Use PowerShell to Set Microsoft SQL Database Owner

$owner='CAP\SQL Admins' $databaseName='TestDb' $sqlServer=$env:computername function setDbOwner{ param( $principle=$env:USERDOMAIN+'\Domain Admins', $databaseName='TestDB', $sqlServer ) function includeSqlTools{ $ErrorActionPreference='stop'…

Basic HTML and HTML5: Create a Set of Checkboxes

<h2>CatPhotoApp</h2><main><p>Click here to view more <a href="#">cat photos</a>.</p><a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying…