<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HTML formatting Archives &#8212; Stampede: the strategic design &amp; technology company</title>
	<atom:link href="https://stampede-design.com/blog/tag/html-formatting/feed/" rel="self" type="application/rss+xml" />
	<link>https://stampede-design.com/blog/tag/html-formatting/</link>
	<description>We are creating better worlds though thoughtful design and technology. Connect with us!</description>
	<lastBuildDate>Tue, 07 Apr 2026 09:08:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.8</generator>

<image>
	<url>https://stampede-design.com/wp-content/uploads/2024/02/cropped-Stampede-Favicon-old-32x32.png</url>
	<title>HTML formatting Archives &#8212; Stampede: the strategic design &amp; technology company</title>
	<link>https://stampede-design.com/blog/tag/html-formatting/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Disable HTML Auto-Formatting in WordPress</title>
		<link>https://stampede-design.com/blog/disable-html-auto-formatting-in-wordpress/</link>
					<comments>https://stampede-design.com/blog/disable-html-auto-formatting-in-wordpress/#comments</comments>
		
		<dc:creator><![CDATA[Shaiful Borhan]]></dc:creator>
		<pubDate>Wed, 08 Dec 2010 17:25:04 +0000</pubDate>
				<category><![CDATA[Field Notes]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[HTML formatting]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=788</guid>

					<description><![CDATA[<p>The "HTML mode" in the WordPress editor doesn't really provide you with total control of the HTML being generated on the frontend. Some of the auto-formatting it does are for instance wrapping your inline elements with &#60;p&#62; and line breaks are also interpreted as &#60;p&#62;. If you're someone who likes full control over the HTML of your content in WordPress, this simple solution might interest you. Shaiful shows you how.</p>
<p>The post <a href="https://stampede-design.com/blog/disable-html-auto-formatting-in-wordpress/">Disable HTML Auto-Formatting in WordPress</a> appeared first on <a href="https://stampede-design.com">Stampede: the strategic design &amp; technology company</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="lead">I find that the &ldquo;HTML mode&rdquo; in the WordPress editor doesn&rsquo;t really provide you with total control of the HTML being generated on the frontend.  Some of the auto-formatting it does are for instance wrapping your inline elements with a &lt;p&gt; and line breaks are also interpreted as &lt;p&gt;.</p>
<p>While this is not a bad thing at all, it is however quite cumbersome if you&rsquo;re using custom shortcodes (that generate divs) in your content creation and you&rsquo;re planning to arrange them nicely in the editor by giving a couple of line breaks for better readability. They will end up in the frontend as &lt;div&gt; wrapped inside a &lt;p&gt;, and you&#8217;ll get some unwanted &lt;br /&gt; as well. Certainly not pretty.
</p>
<p>The auto-formatting function will still run even if you disabled the visual editor entirely because it is not part of the TinyMCE editor. In fact it is performed via a function in WordPress called <a href="http://codex.wordpress.org/Function_Reference/wpautop" target="_blank">wpautop</a> that runs before the content is displayed on the frontend. Thus it is possible to bypass this feature by using the remove_filter function in our theme function.php file. The simple code for a global site-wide effect is:
</p>
<pre class="brush: php; title: ; notranslate"> 
   remove_filter('the_content', 'wpautop');
</pre>
<p>A more elegant approach would be to use a custom field to control which content will bypass wpautop and which not. This way we can still take advantage of the usefulness of the wpautop function for pages that doesn&rsquo;t require fancy HTML. The code below also goes in the function.php file.
</p>
<pre class="brush: php; title: ; notranslate">
function WP_auto_formatting($content) {
    global $post;
    if(get_post_meta($post-&gt;ID, 'disable_auto_formatting', true) == 1) {
        remove_filter('the_content', 'wpautop');
    } 
    return $content;	
}
add_filter( &quot;the_content&quot;, &quot;WP_auto_formatting&quot;, 1 );
</pre>
<p>Using this method, you simply have to add a custom field in your post/page called disable_auto_formatting and give it a value of 1 to bypass the wpautop function. To enable auto formatting, simply change the value to 0 or delete the custom field.   </p>
<p>Have a nice day! </p>
<p>The post <a href="https://stampede-design.com/blog/disable-html-auto-formatting-in-wordpress/">Disable HTML Auto-Formatting in WordPress</a> appeared first on <a href="https://stampede-design.com">Stampede: the strategic design &amp; technology company</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stampede-design.com/blog/disable-html-auto-formatting-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
