Preserve Code Formatting
A plugin for WordPress that preserves formatting of code for display by preventing its modification by WordPress and other plugins while also retaining whitespace.
This plugin is available in the WordPress Plugin Directory: https://wordpress.org/plugins/preserve-code-formatting/
- Install via the built-in WordPress plugin installer. Or install the plugin code inside the plugins directory for your site (typically
- Activate the plugin through the 'Plugins' admin menu in WordPress
- Go to the 'Settings' -> 'Code Formatting' admin settings page (which you can also get to via the Settings link next to the plugin on the Manage Plugins page) and customize the settings.
- Write a post with code contained within opening and closing
codetags (using the HTML editor, not the Visual editor).
This plugin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.