Anti-Word Alert

/ Published in: PHP
Save to your folder(s)

I've yet to work on a WordPress site where at least once post wasn't copied from Microsoft Word, producing a mess of inline tags and awful markup.

This helps prevent that, just a little.

Copy this code and paste it in your HTML
  1. add_action( 'admin_notices', 'custom_admin_notice' );
  2. function custom_admin_notice(){
  3. global $current_screen;
  4. if ( $current_screen->parent_base == 'edit' )
  5. echo '<div class="updated"><p><strong>NOTE</strong> - Please do not copy and paste text from Microsoft Word. You can write and save your post here in WordPress, or copy it from a plain text app (Notepad or TextEdit). Microsoft Word adds a ton of messy inline tags that break things.</p></div>';
  6. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.