I am interpreting the question to mean that you already have Word markup in your post and so you need to clean that up via PHP. If so…
- You can see the code that cleans up Word content here:
http://core.trac.wordpress.org/browser/trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js#L375
That is Javascript. With some work, you could convert that to PHP. - PHP Tidy, if available, will clean that up.
- I believe that HTML Tidy can do it.
strip_tags
will just get rid of the code. (Tested)wp_kses
will get rid of much of it but will take some tweaking to
work well, at least as indicated by my simple test. Maybe with the right arguments it can do what you want.
Related Posts:
- Change padding to text indent in “Increase indent” TinyMCE
- Format the Layout of Images In The Edit Post Textarea?
- Keyboard shortcut for headings on safari
- disable WP automatically inserted line breaks after an image
- Pasting code into pre-formatted text in Visual Editor not working in 3.3.1
- How do I convert a mathematical Microsoft Word document to a WordPress blog post?
- Is there a WordPress equivalent to MediaWiki templates
- Automatically added brs and paragraphs?
- How to add a custom button to the tinyMCE toolbar?
- How to remove_filter that filters iframes in posts? [duplicate]
- Remove whitespace at the end of posts?
- Remove double space after a period
- Code Blocks with WYSIWYG in blog post
- 2nd button row from WP Super Edit or TinyMCE Advanced doesn’t show to 2nd admin
- How to add a custom field after wp post
- Link button is not working while editing a post in Firefox [closed]
- Remove permalink from images when inserting into post
- WordPress’ visual editor messing up my (nested) lists (and other things as well)
- Number format for wp_count_posts()
- Unautop / Sanitize content added to a post through a plugin
- Apostrophe in a possessive appears as an open-single-smart-quote instead of a closed one
- Posting blog entries in screenplay format
- How to get post body look same as my visual editor?
- Can’t give tags rels
- Can’t update WordPress Page if post_content is Empty
- How to determine if a post was last edited in the Visual Editor
- Pasting formatted text from MS-Word
- Right align a youtube video
- All images on one line for each post
- How to add future Posts to the new “Internal Linking” Feature
- Order buttons added to TinyMCE
- ‘QTags.addButton: arg2 distorts the button rather than just shows
- How can I change the date format of the revision list?
- WordPress 5: prevent link from displaying page title instead of URL
- How to allow some visitors to edit inline specific post
- Post formatting bug in WordPress
- Theme does not respect spaces between paragraphs in pages
- When I click edit on a post, all the content disappear. Does anyone know how to fix this?
- Formatting error while publishing theblog from Microsoft Word
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- Blog Post slider not working
- Double loop output
- AJAX load more posts not using correct category and repeating the same few posts
- I need some explanation on global $post [duplicate]
- Custom permalink for wordpress page / post
- How to Display Most View Post in the template file?
- Multiple Pages – Seperate blogs
- display multiple posts and posts content on a single URL
- Order result from ajax
- Show post published live
- how i show manual data in a post
- New blog post published notification – Buddypress
- Change archive results based on GET request
- Custom post styling per category?
- Let Contributors Review only (Not Publish) Others Posts
- problem with admin panel
- What is the difference between options and custom fields (meta) in WordPress?
- Word /blog/ in slug post, problems in CPT. Solutions?
- Creating a frontend blog post form for logged in users only
- Using WP page password protection as defacto login
- Category posts show on local install, they do not show on live server
- How to add post under particular pages? Like website.com/page1/post1
- get current index of post content in category page
- Permalink structure for two seperate blogs
- Display number of post published every day
- wp_query args with relation
- Posts content is display added with title, instead of content, using the_excerpt()
- How to hide meta from search result only on pages?
- Ajaxify Post Sort
- How do I display posts ordered by a date custom field?
- WP_Query sort by meta_value_num or date
- Category and Posts in front page
- wpautop filter off for pages but on for posts
- Page Template Drop down disappears when static front page is selected
- How to show category image if no featured image is set?
- 2 Domains, Same Content, Different Titles?
- Prevent WordPress from putting around specific element
- How to add category base prefix to wordpress permalink
- Get post id outside loop : Notice: Trying to get property of non-object
- Adding wordpress posts using phpmyadmin
- I lost the link to my posts in my menu bar
- Colorbox not working on native WordPress gallery when gallery is loaded thru AJAX
- filter buddypress users posts by user ‘xprofile’ custom fields
- WP_Query to get posts in a specific tag or has post_format
- Allow registering user to select post category when signing up to blog
- Add post id as body class in wordpress admin dashboard [duplicate]
- how to call recent post content in a loop ( only the content before read more tag)
- calling pages instead of posts
- How can I exclude only a specific sub category post from category display?
- Category URL to use same string as Post URL Permalink
- How can I view my posts in ascending order by number of views
- Customizing URL slugs of Custom Post Type and Taxonomy make posts/pages 404
- Override wp_link_pages pagebreak with filter
- WordPress display page information rather than post
- Post Category link is same with Page link
- testing result of $.post with json_encode
- How do I change the post title’s link on the posts page?
- Why do some post, listed under the “Mine” Tab, and the same posts listed tunder “Published” Tab
- Clean up customize_changeset in DB
- I need show posts by customer (Shortcode)