add p tag back in wordpress
To add the <p>
tag back in WordPress, follow these steps:
- Log in to your WordPress dashboard.
- Navigate to "Appearance" and select "Theme Editor."
- Locate the "functions.php" file on the right-hand side.
- Click on "functions.php" to open it for editing.
- Insert the following code at the bottom of the "functions.php" file:
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
- Click the "Update File" button to save the changes.
Adding these lines of code to the functions.php
file removes the automatic addition of <p>
tags by the wpautop
function in WordPress. This function is responsible for adding <p>
tags to post content and excerpts. By removing these filters, you prevent WordPress from automatically inserting <p>
tags around content.