WordPress processes text entered in the Write Post Panel multiple times before the text is finally displayed on a web page within your WordPress blog. The processing of the text filters out the unwanted code and conforms the text to a form that the browser can interpret. Without attention to detail and familiarity with WordPress’s post content filtering, this can cause unwanted changes.
The majority of the conversion and filters are found in the wp-includes/formatting.php
file.
Some typical problems some users have with these filtering and processing functions are:
- Empty paragraphs, closing span tags, and line break (BR) elements are removed upon saving.
- Classes are removed from elements.
- DIV elements are converted to P elements.
- Javascripts and code are converted to displayable code rather than actionable code. See Using Javascript for information on how to incorporate Javascript into a blog post.
The following is step-by-step list of how WordPress processes post content text before the final version is displayed.
TinyMCE
TinyMCE is the editor used by WordPress, known as the Rich Text Editor. Not all WordPress bloggers use it, but if you do, it will change various codes upon saving an entry to prepare it for publishing.
wpautop() WordPress Function
wpautop()
is a core WordPress function that automatically processes, fixes, and modifies the text of a post.
It puts in line breaks, paragraph tags, opens and closes tags that aren’t opened and closed, and cleans up duplicate HTML tags.
WordPress is the best tools ever. WordPress can easily post the content and create a website.