Making a WordPress code block monospace

Say you’re on WordPress, and say you have a code block.

This is a code block.

That’s fine, but with code I usually want monospace:

This is monospace code.

The way to do that is as follows:

1. Create a code block.
2. Click "More" (the downward caret) in the formatting menu that goes with the block.
3. Click "Keyboard input".

As you can see above, you can apply it to individual lines or to all the code, just like formatting any other bit of text.

I had to search a bit to find this, so I’m posting primarily as a reminder to myself.

These steps work as of the time of this writing. They could always change.

Leave a Comment