Created
April 25, 2012 08:17
-
-
Save eboyer/2488142 to your computer and use it in GitHub Desktop.
WP Import Cleanup (Removing some inline styles after a import)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="text-align: center;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="text-align: left;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, 'aligncenter', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, 'aligncenter ', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '<img class=" ', '<img class="'); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '<strong>', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '</strong>', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '<font>', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '</font>', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '<b>', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '</b>', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '<i>', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '</i>', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, 'style="font-weight: normal;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="color: #262626; font-family: Cambria; font-size: small;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="font-family: Cambria; font-size: small;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="font-family: Cambria;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="color: #262626;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="color: #339966;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="color: #008000;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="color: #003300;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="color: #000000;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="color: black;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="color: #0000ee;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="color: #000000; font-weight: normal;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="font-weight: normal; font-size: 13px;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="font-size: 13px; font-weight: normal;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, ' style="text-decoration: underline;"', ''); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '“', '“'); | |
UPDATE at_posts SET post_content = REPLACE(post_content, 'â€', '”'); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '’', '’'); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '‘', '‘'); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '—', '–'); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '–', '—'); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '•', '-'); | |
UPDATE at_posts SET post_content = REPLACE(post_content, '…', '…'); | |
DELETE FROM at_terms WHERE term_id IN (SELECT term_id FROM at_term_taxonomy WHERE count = 0 ); | |
DELETE FROM at_term_taxonomy WHERE term_id not IN (SELECT term_id FROM at_terms); | |
DELETE FROM at_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM at_term_taxonomy); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I NEED A CLEANER WAY TO DO THIS.