This happens because of WordPress’s wpautop
.
Simply add below line of code in your theme’s functions.php file
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
For more information: http://codex.wordpress.org/Function_Reference/wpautop
Related Contents:
- Using WPDB in standalone script?
- Remove category & tag base from WordPress url – without a plugin
- PHP Warning: POST Content-Length of 8978294 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
- Can I install/update WordPress plugins without providing FTP access?
- WordPress putting %E2%80%8E at the end of my url, howcome?
- WordPress Site Keeps Getting Hacked
- How can I get the current page name in WordPress?
- WordPress filter to modify final html output
- Get cart item name, quantity all details woocommerce
- wp_nav_menu change sub-menu class name?
- Retrieve WordPress root directory path?
- WooCommerce: Add input field to every item in cart
- Woocommerce checkout page internal server error
- How to include pagination in a WordPress Custom Post Type Query
- WordPress asking for my FTP credentials to install plugins
- WordPress REST API (wp-api) 404 Error: Cannot access the WordPress REST API
- How do I debug a WordPress plugin?
- WP – Use file in plugin directory as custom Page Template?
- pagination on custom post wp_query
- Why is WordPress placing “text/rocketscript” instead of “text/javascript” when using wp_register_script()?
- Remove category and tag base from WordPress URLs without a plugin?
- Warning: preg_replace(): Unknown modifier
- Get Order items and WC_Order_Item_Product in WooCommerce 3
- TypeError: ‘undefined’ is not a function (evaluating ‘$(document)’)
- Access denied for user ‘root@localhost’ (using password:NO)
- The plugin generated X characters of unexpected output during activation (WordPress)
- How to debug in WooCommerce 3+
- Correct file permissions for WordPress [closed]
- Column count doesn’t match value count at row 1
- WooCommerce action hooks and overriding templates
- Create programmatically a WooCommerce product variation with new attribute values
- PHP – Merging two arrays into one array (also Remove Duplicates)
- How to include WordPress functions in custom .php file?
- Update fee dynamically based on radio buttons in Woocommerce checkout
- Cross-Origin Request Blocked on
- Create a folder if it doesn’t already exist
- WooCommerce: Assigning an endpoint to a custom template in my account pages
- MySQL Order before Group by
- Hide shipping methods for specific shipping class in WooCommerce
- Add a new custom field to WooCommerce checkout and display on admin order pages and email notifications
- Insert PHP code In WordPress Page and Post
- WooCommerce: Set country by default in checkout page
- How should I change the woocommerce_form_field HTML Structure?
- Display custom order meta data value in email notifications WooCommerce
- Multiple excerpt lengths in wordpress
- WordPress path url in js script file
- How to load all server side data on initial vue.js / vue-router load?
- WordPress: Loading multiple scripts with enqueue
- Executing PHP code inside a .js file
- Woocommerce add to cart button redirect to checkout