Remove Automatic Paragraphs In Shortcodes

Paulund is full of premium tutorials and support to help with your development

Sign up to get full access to all tutorials.

Get Started

Login to your account

Code

This post is an extension to the post I wrote some time ago about displaying code snippets on a WordPress site. This post showed how you can create a WordPress plugin which makes a shortcode for a number of different languages which will encode the content so that you can display code snippets on your WordPress site. Using this plugin you will have access to 4 shortcodes html, css, javascript and php. But because we were encoding the content using htmlentities it caused some problems with the way WordPress renders content. WordPress will automatically change double line breaks to paragraph tags. In this article we will see what those problems are and come up with a solution to solve them.

Get Started