How to force insertion in editor

Facilitating users to write content in an external editor, and then copy/paste it into the WordPress editor, is a fundamentally bad approach, and is fraught with issues. The WordPress editor is intended to be used to write content. You should train your users to use the post editor to write content, as opposed to using it as a receptacle for pasting content from another editor.

When I paste text from different sources into the wordpress (tinyMCE) content visual editor I am getting different results.

That’s because WordPress is not intended for copy-pasting content into the editor, but rather for using the editor to write content.

Ironically, it works how I want it to when pasting from MSWord, but not when going from notepad (or another website, or notepad++).

That’s because WordPress includes a hackish Paste-From-Word button, to placate the people who persist in this unintended use of the WordPress post editor.

The big issue here is the

: linebreak issue. I want the client to be able to paste a few paragraphs of text in and be able to set the margins and padding so as to make it look nice.

The paragraph tags are added automatically by an output filter. If you need to adjust the style of the paragraphs, you should do so via CSS, not in the post editor.

This must be a pretty normal expectation, and I am suprised that I am having difficulties with this, as I have built several WP sites before without noticing this issue.

The main thing is to ensure that the copy-pasted content actually has newlines, so that WordPress can add the paragraph tags where appropriate.

EDIT

I was using a combination of get_the_content() and the_content(). Apparently the former will strip out these tags, just leaving a block of text (which still leaves me in a predicament but im sure i’ll figure something out)

Actually, it’s not that get_the_content() strips out <p> tags, but rather that the <p> tags are applied via filters applied to the_content(), specifically, wpautop().

If you need to apply content filters to content returned by get_the_content(), use the following:

<?php
$some_content = apply_filters( 'the_content', get_the_content() );
?>

That will manually apply all content filters to get_the_content().