Better Blockquotes

WordPress has a button in the editor for adding blockquotes to a post. But what if an author wants to add a citation? Unfortunately, it’s not possible without a little HTML knowledge.

This is a problem I’ve thought about a bit when designing DevPress themes (what markup should I be styling for?), but it’s also come up on a few client projects recently. Citations are a pretty common use-case, and it would be great if they were easier to add.

My solution was to build a plugin that replaces the existing TinyMCE button for blockquotes with an enhanced one.

I wrote this as a standalone plugin, but also as proof-of-concept for a core patch. If text is selected, it works exactly the same as the current blockquote button in the WordPress editor. However, if no text is selected, a pop-up modal is displayed with additional fields. These include: quote, citation, and citation link.

Everyone loves blockquotes with citations!
Abraham Lincoln

Right now the Better Blockquotes plugin is on GitHub. I’d love for other developers to review it and give me feedback. If no bugs turn up, I’ll submit it to the WordPress repository shortly.

I’m also curious if this is a feature people would even like to see in WordPress core? I’m not familiar enough with TinyMCE yet to understand how this sort of patch could be written, but get in touch if you’re interested! Or, tell me why it’s a bad idea.

Want the Better Blockquotes plugin right now? Download the latest version

4 Responses

  1. This is really smart – I have a use in mind for it already and will give it a try. I’ve added formats and buttons to the MCE editor but never considered overriding a button that already exists.

  2. I love to see this. I’d also add a class option, or a dropdown even, so someone can select “big fancy blockquote” or “big long blockquote”. I’d love to mix it up with blockquotes more, and sometimes make them big and decorative like an inline pullquote, and othertimes just for actual large blocks of text.

    Great work! I’d probably install this as soon as you release it :)

Leave a Reply