Back to Support Content and Media Blocks Code Block

Code Block

With the Code block you can add formatted code for others to view.

Adding content to the code block will wrap the content in  tags.
Adding content to the Code block will wrap the content in tags.

Add a Code Block

In order to add a Code block, click on the Block Inserter icon.

Add the code block from the Block Inserter icon or the slash command /code.
Add the Code block from the Block Inserter icon or the slash command /code.

You can also type /code and hit enter in a new paragraph block to add one quickly.

Use the slash command /code to insert a code block.
Use the slash command /code to insert a Code block.

Check out our detailed instructions on how to add content using blocks.

Block Toolbar

Each block has its own block-specific controls that allow you to manipulate the block right in the editor. The Code block has some tools in the block toolbar that you can use to change the formatting of your text.

Block toolbar for the Code block.

In addition to adding links, making text Bold or Italic, you can also do various other formattings within the Code block by clicking the down-arrow and choosing the desired option.

Block Interface

Each block has its own block-specific controls that allow you to manipulate the block right in the editor. The Code block only offers the block settings icon in the block toolbar. Optionally, you can transform the Code block into a preformatted block.

The Code block only offers the block settings icon in the block toolbar.
The Code block only offers the block settings icon in the block toolbar.

Block Settings

When you select a block, you will find additional block settings in the right sidebar. If you do not see the sidebar, you may need to click the Settings icon in the top-right corner to bring up the settings. This icon looks like a square with two uneven columns:

The settings icon in the Editor with a tooltip "Settings" below it.
Click the Settings icon to open the block settings

The Paragraph block includes the following settings:

Was this guide helpful for you?

Not quite what you're looking for? Get Help!

Copied to clipboard!