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

Explain Try and Catch Block

try { Execute function X; Execute function Y;}catch{ Execute this when any function fails: X…

WinRM Management Consideration

Infrastructure needs to be able to leverage scripting automation to perform Vulnerability Remediation, Resource Provisioning,…

PowerShell: Get SQL Job History

$computername='sql01' function getSqlJobHistory($sqlServerName){ try{ if(!(get-module SqlServer)){ Install-Module -Name SqlServer } Import-Module -Name SqlServer $sqlServerInstance=Get-SqlInstance -ServerInstance…