How to get rid of p tag in WordPress?

How to get rid of p tag in WordPress?

The best and cleanest way to get rid off this tag is to remove the filter that applies it. Go to your functions.php file (Appearance > Editor > functions.php) and add the following code at the end of this file: view source print? if you want to remove P tag from around content output, add this in the file:

How do you hide tags after a post in WordPress?

Step 1: From the WordPress dashboard navigate to following: Appearance >> Customize. Step 2: Click on Post Option then scroll down where you will see “Tags list after the post”. Step 3: Just click on the button on the left to hide the tags.

When to add P and BR tags in WordPress?

Often while updating pages or posts in WordPress, it automatically adds p and br tags automatically at the end of paragraphs. This behavior specially happens when copying text from HTML file to the WordPress editor. This can be really frustrating and keeps on messing with the page structure.

Can a WordPress theme work with all tags?

It depends on the theme you are using but in most cases, the code will work with almost all themes because it is a simple code irrespective of theme modification. If you look on the topic in WordPress forums then you may come up with different types of tags based on the theme they are using.

How to remove p tag from category description?

if you want to remove P tag from around content output, add this in the file: remove_filter (‘the_content’, ‘wpautop’); to remove P tag from category description, use: remove_filter(‘term_description’,’wpautop’); Another method of removing extra P tag: There is also a way to get raw text without removing the filter.

Why do I need to disable the wpautop filter?

Put simply, the wpautop () filter changes double line-breaks in the text into HTML paragraphs ( … ). This can, however, sometimes have annoying side affects. For example, it adds paragraph tags around image and script tags. This can have strange affects on page layouts, and may break scripts.

How to disable wpautop in WP Edit Pro?

First, we need to enable the “Disable wpautop ()” option (yes, double-negative). Visit the plugin options page -> Posts/Pages Options tab. WP Edit Pro also allows the administrator to select which post types will display the option to disable the wpautop () filter.