R
R
Ruslan Makarov2016-01-16 14:41:14
MySQL
Ruslan Makarov, 2016-01-16 14:41:14

How to massively get rid of indents in WordPress posts?

Good day!
I changed the template on the site, and now many posts have large spaces between paragraphs (on the old design they were put on purpose when an extra indent was needed for beauty).
In the code, they look like this (empty paragraphs):
<p>&nbsp;</p>
But with the new design, they are not needed... And now they look like this: Can you tell me
509f390917c0460397431b16fbf7634f.png
a way to get rid of them en masse? WordPress engine.
Tried through phpmyadmin search - does not search.
Any thoughts? Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Seredny, 2016-01-16
@facepook

add_filter('the_content','your_delete_function');

function your_delete_function($content) {
return str_replace('?<p>&nbsp;</p>?', '', $content);
}

Experiment regularly. to choose the right option.
Though, all the same to do through search and replacement on a DB. Dump wp_posts, download it to your computer and use a text editor to "find and replace" these spaces with nothing.

X
xmoonlight, 2016-01-16
@xmoonlight

You need to edit the template yourself or freelance.
I would replace 1 time <p>&nbsp</p>with
and then I would rule the style of the .spacer class

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question