Disable WordPress Auto Formatting

Sometimes WordPress can be extremely annoying with the Auto Formatting. Often it will add a

or a
where you don’t want one and it will totally mess up the look of your page. Do how do we fix this?

There are a couple of options.

1. You can get a plug-in to disable the auto formatting completely. Such as this one. PS Disable Auto Formatting. The downside to this plug in is that it kills the auto formatting fro your entire site, which might mess up a lot of page you have already finished with

2. Another option — and a better option — is to create a custom field that will allow you to disable the auto formatting only on the pages you want to disable it.

I learned this trick here

So in this method we edit our functions.php to include the following:

function WP_auto_formatting($content) {
    global $post;
    if(get_post_meta($post->ID, 'disable_auto_formatting', true) == 1) {
        remove_filter('the_content', 'wpautop');
    }
    return $content;
}
add_filter( "the_content", "WP_auto_formatting", 1 );

Now we are able to set a custom field of “disable_auto_formatting” and give it a value of 1. This will disable the auto formatting on that page only.

Very sweet. WP 3.21 compatible.

Will Facebook ads still be effective in 2023?

By Dave Fogel | December 20, 2022

Yes, We predict Facebook Ads will still be effective in 2023. Facebook has made several changes to its advertising platform since the iOS 14 update that caused them to lose most of its tracking ability when users left the platform.  Long story short, FB could no longer see where users went after they left the…

Why should you use Google Ads?

By Dave Fogel | December 20, 2022

Google Ads is an advertising platform created by Google that allows businesses to reach potential customers and increase their online visibility. It is a powerful tool that can be used to target specific audiences and promote products and services. Google Ads enables businesses to create engaging ads that can be delivered to the right people…

Why Google Ads is better than Facebook Ads

By Dave Fogel | December 19, 2022

Google Ads offers businesses a number of advantages over Facebook Ads. Google Ads allows businesses to target specific locations and audiences, allowing them to reach the people that are most likely to be interested in their services. Additionally, Google Ads offers businesses more control over their campaigns, allowing them to adjust their campaigns in real-time…

Posted in

Dave Fogel

Leave a Comment