1

So i know that wordpress will auto clean / format html within posts / pages automatically when switching back and forth from text to visual:

https://stackoverflow.com/questions/9907757/wordpress-keeps-cleaning-my-post-format-html

Is there a way to trigger that on all of my current posts (46,000+) automatically to clean my posts html

imported a bunch of posts using a custom script and there seems to be an issue,

however I've noticed if I change from

text --> visual --> text

the posts start working perfectly.

So looking to see if there is a wordpress function or script i can run to correct this issue.

Here's what it looked like before formatting:

<div class="article-body" itemscope="" itemtype="https://schema.org/Article">
<div>

</div>
<div itemprop="author" itemscope="" itemtype="http://schema.org/Person" class="author">
<a href="/author/julie-gerstein/">Julie Gerstein</a>
<span class="date">2.23.12</span>
</div>
<div class="social-holder">
<div class="social-icons post-header">
<div class="social-container">
<div class="logo"><a href="/"/></div>
<div class="title">Share this article:</div>
<div class="email sharrre" data-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-short-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-utm-source="share-email" data-text="Just A Kitten Making Biscuits On A Pug" data-title="Email"/>
<div class="facebook sharrre" data-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-short-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-utm-source="share-fb" data-text="Just A Kitten Making Biscuits On A Pug" data-title="Share"/>
<div class="twitter sharrre" data-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-short-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-utm-source="share-tw" data-text="Just A Kitten Making Biscuits On A Pug" data-title="Tweet"/>
<div class="pinterest sharrre" data-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-short-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-utm-source="share-pnt" data-text="Just A Kitten Making Biscuits On A Pug" data-title="Pin It" data-media="/uploads/2012/02/22/kitten_022212_m.jpg"/>
<div class="reddit sharrre" data-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-short-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-utm-source="share-red" data-text="Just A Kitten Making Biscuits On A Pug" data-title="Reddit"/>
</div>
</div> </div>

<div class="resize728">
<div class="ad cpxadvert_placement-31" id="advert_pl-31_ad-25"><div class="topadtxt">Advertisement</div>

<div id="div-gpt-ad-1485454873818-0" style="height:90px; width:728px;">
<script><![CDATA[
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1485454873818-0'); });
]]></script></div></div>
</div>
<div class="resize728">
</div>
<div class="featured-embed-holder format-video">
<div class="article-video-holder">
<div class="mainembed videoembed mainembed-400x300 align- cbme-video-swap">
<div class="video-embed-code">
<iframe width="400" height="300" src="https://www.youtube.com/embed/JQEbqKmuDzM?version=3" frameborder="0" allowfullscreen=""/>
</div>
</div>
</div>
</div>
<div class="article-content-holder">
<div itemprop="articleBody" class="single-content-holder">
<div class="article-content clearfix" itemprop="articleBody">
<p>Confirmed: Kittens love making paw biscuits, and they will do it whenever and wherever they please. Kittens just being kittens! As such, this pug is enjoying a special personal biscuit sesh that seems to be putting him to sleep. [<a href="http://www.tastefullyoffensive.com/2012/02/snoring-pug-gets-massaged-by-cat.html?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+TastefullyOffensive+%28Tastefully+Offensive+%7C+Premium+Funny%29" target="_blank">Tastefully Offensive</a>]</p>
</div>
</div>

<div class="resize728">
<div class="ad cpxadvert_placement-33" id="advert_pl-33_ad-23"><div class="topadtxt">Advertisement</div>

<div id="div-gpt-ad-1485455049912-0" style="height:90px; width:728px;">
<script><![CDATA[
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1485455049912-0'); });
]]></script></div></div>
</div>
<div class="ad cpxadvert_placement-46" id="advert_pl-46_ad-31"><div id="taboola-below-gallery-thumbnails-sc-1"/>
<script type="text/javascript"><![CDATA[
  window._taboola = window._taboola || [];
  _taboola.push({
    mode: 'thumbnails-c',
    container: 'taboola-below-gallery-thumbnails-sc-1',
    placement: 'Below Gallery Thumbnails SC 1',
    target_type: 'mix'
  });
]]></script></div>
<div class="row tags-and-comments">
<div class="col-sm-9">
<div itemprop="keywords" class="tags">
<strong>Tags:</strong>
<a href="/tag/animals/">animals</a>, <a href="/tag/biscuits/">biscuits</a>, <a href="/tag/cat/">cat</a>, <a href="/tag/cute/">cute</a>, <a href="/tag/cute-animals/">cute animals</a>, <a href="/tag/dogs/">dogs</a>, <a href="/tag/kitten/">kitten</a>, <a href="/tag/pug/">pug</a> </div>
</div>
</div>

<div class="resize728">
</div>
</div>
</div>

and afterwards once I switch between text and visual:

<div class="article-body">
<div></div>
<div class="author"><a href="/author/julie-gerstein/">Julie Gerstein</a>
<span class="date">2.23.12</span></div>
<div class="social-holder">
<div class="social-icons post-header">
<div class="social-container">
<div class="logo"></div>
<div class="title">Share this article:</div>
<div class="email sharrre" data-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-short-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-utm-source="share-email" data-text="Just A Kitten Making Biscuits On A Pug" data-title="Email">
<div class="facebook sharrre" data-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-short-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-utm-source="share-fb" data-text="Just A Kitten Making Biscuits On A Pug" data-title="Share">
<div class="twitter sharrre" data-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-short-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-utm-source="share-tw" data-text="Just A Kitten Making Biscuits On A Pug" data-title="Tweet">
<div class="pinterest sharrre" data-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-short-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-utm-source="share-pnt" data-text="Just A Kitten Making Biscuits On A Pug" data-title="Pin It" data-media="/uploads/2012/02/22/kitten_022212_m.jpg">
<div class="reddit sharrre" data-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-short-url="/2012-02-23/just-a-kitten-making-biscuits-on-a-pug/" data-utm-source="share-red" data-text="Just A Kitten Making Biscuits On A Pug" data-title="Reddit"></div>
</div>
</div>
<div class="resize728">
<div id="advert_pl-31_ad-25" class="ad cpxadvert_placement-31">
<div class="topadtxt">Advertisement</div>
<div id="div-gpt-ad-1485454873818-0" style="height: 90px; width: 728px;"><script><![CDATA[ googletag.cmd.push(function() { googletag.display('div-gpt-ad-1485454873818-0'); }); ]]></script></div>
</div>
</div>
<div class="resize728"></div>
<div class="featured-embed-holder format-video">
<div class="article-video-holder">
<div class="mainembed videoembed mainembed-400x300 align- cbme-video-swap">
<div class="video-embed-code">

<iframe src="https://www.youtube.com/embed/JQEbqKmuDzM?version=3" width="400" height="300" frameborder="0" allowfullscreen="allowfullscreen">
<div class="article-content-holder">
<div itemprop="articleBody" class="single-content-holder">
<div class="article-content clearfix" itemprop="articleBody">

Confirmed: Kittens love making paw biscuits, and they will do it whenever and wherever they please. Kittens just being kittens! As such, this pug is enjoying a special personal biscuit sesh that seems to be putting him to sleep. [<a href="http://www.tastefullyoffensive.com/2012/02/snoring-pug-gets-massaged-by-cat.html?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+TastefullyOffensive+%28Tastefully+Offensive+%7C+Premium+Funny%29" target="_blank">Tastefully Offensive</a>]

</div>
</div>
<div class="resize728">
<div class="ad cpxadvert_placement-33" id="advert_pl-33_ad-23">
<div class="topadtxt">Advertisement</div>
<div id="div-gpt-ad-1485455049912-0" style="height: 90px; width: 728px;">
<script><![CDATA[ googletag.cmd.push(function() { googletag.display('div-gpt-ad-1485455049912-0'); }); ]]></script></div>
</div>
</div>
<div class="ad cpxadvert_placement-46" id="advert_pl-46_ad-31">
<div id="taboola-below-gallery-thumbnails-sc-1"></div>
<script type="text/javascript"><![CDATA[ window._taboola = window._taboola || []; _taboola.push({ mode: 'thumbnails-c', container: 'taboola-below-gallery-thumbnails-sc-1', placement: 'Below Gallery Thumbnails SC 1', target_type: 'mix' }); ]]></script>

</div>
<div class="row tags-and-comments">
<div class="col-sm-9">
<div itemprop="keywords" class="tags">
<strong>Tags:</strong>
<a href="/tag/animals/">animals</a>, <a href="/tag/biscuits/">biscuits</a>, <a href="/tag/cat/">cat</a>, <a href="/tag/cute/">cute</a>, <a href="/tag/cute-animals/">cute animals</a>, <a href="/tag/dogs/">dogs</a>, <a href="/tag/kitten/">kitten</a>, <a href="/tag/pug/">pug</a></div>
</div>
</div>
<div class="resize728"></div>
</div>
&nbsp;

</iframe>

</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

cant see exactly what its doing to fix my issue when i do this but it makes the pages work again.

  • What is it doing that's fixing your posts? If you can identify what it did specifically your question will be significantly easier to answer – Tom J Nowell Jul 26 '18 at 23:18
  • Hi @TomJNowell thanks for commenting I updated my question – Ninja Panda Jul 27 '18 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.