You’ve probably pasted code into WordPress’ Text editor, then switched to the Visual Editor, and found that parts of your code were stripped out. The Post Snippets plugin prevents that from happening. It lets you create snippets of text and HTML that can be entered as shortcodes into WordPress pages and posts. For example, you can create shortcodes for
- Google Maps
- Google Calendars
- PayPal buttons
- Addresses encoded using schema.org
- Any other embed code
You can also create snippets for any text that you want to reuse throughout a site. Just create a snippet for the text, then insert the shortcode in any pages or posts that need that text.
Post Snippets can do much more than I’ve explained here. To learn more, open the Help tab on the Post Snippets settings page, and see the official Post Snippets documentation. Here’s an explanation of how to use variables with Post Snippets.
Do you use Post Snippets? If not, do you use a similar plugin, or have some other way you deal with code snippets in WordPress?