The Code block displays code on your site with syntax highlighting, making it ideal for code snippets in tutorials and technical documentation. In this guide, you will learn how to add a Code block, customize its appearance, and use its enhanced features.
In this guide
Have a question?
Ask our AI assistantTo add a Code block to your page or post, follow these steps:
- Click the + block inserter button and search for “Code.”
- Click the Code block to add it to your content.

- Paste or write your code in the Code block.

💡
Type
/codeon a new line and press Enter to quickly add a Code block.
For more information, visit our detailed instructions on adding blocks.
The Code block supports syntax highlighting for many programming languages. When you select a language, your code displays with color-coded formatting that makes it easier to read.
To select a language, follow these steps:
- Click on your Code block to select it.
- In the block toolbar, click the language dropdown (set to “Plain Text” by default).
- Select your desired language from the list.

The syntax highlighting appears both in the editor and on the published page.

The Code block supports syntax highlighting for over 120 programming languages, including popular options like JavaScript, TypeScript, PHP, Python, HTML, CSS, JSON, SQL, Ruby, and Shell.
View all supported languages
- Plain text
- APL
- ASN.1
- Brainf***
- C
- C#
- C++
- Clojure
- ClojureScript
- Closure Stylesheets (GSS)
- CMake
- Cobol
- CoffeeScript
- Common Lisp
- CQL
- Crystal
- CSS
- Cypher
- Cython
- D
- Dart
- diff
- DTD
- Dylan
- ECL
- edn
- Eiffel
- Elm
- Erlang
- F#
- Factor
- Forth
- Fortran
- Gas
- Gherkin
- Go
- Groovy
- Haskell
- Haxe
- HTML
- HXML
- IDL
- Java
- JavaScript
- Jinja2
- JSON
- JSON-LD
- JSX
- Julia
- Kotlin
- LaTeX
- LESS
- Liquid
- LiveScript
- Log
- Lua
- Markdown
- Mathematica
- Mbox
- mIRC
- Modelica
- MscGen
- MsGenny
- MUMPS
- NSIS
- NTriples
- Objective-C
- Objective-C++
- OCaml
- Octave
- Oz
- Pascal
- Perl
- PGP
- PHP
- Pig
- PLSQL
- PowerShell
- Properties files
- ProtoBuf
- Pug
- Puppet
- Python
- Q
- R
- RPM Spec
- Ruby
- Rust
- SAS
- Sass
- Scala
- Scheme
- SCSS
- Shell
- Sieve
- Smalltalk
- SML
- SPARQL
- SQL
- Squirrel
- Stylus
- Swift
- SystemVerilog
- Tcl
- Textile
- TOML
- Troff
- TSX
- TTCN
- TTCN_CFG
- Turtle
- TypeScript
- VB.NET
- VBScript
- Velocity
- Verilog
- VHDL
- Vue
- Web IDL
- WebAssembly
- XML
- XQuery
- Xù
- Yacas
- YAML
- Z80
The Code block includes several display options to enhance readability and usability for your visitors.
To access the Code block‘s settings, follow these steps:
- Click on your Code block to select it.
- Open the block settings in the right sidebar.
The Code block includes the following settings:
- Language: Select the code language.
- Filename: Display a filename at the beginning of your code block so readers know which file to edit or create.
- Show language name: Display the programming language name at the beginning of your code block.
- Show copy button: Add a button that allows visitors to copy your code with one click.
- Show line numbers: Add line numbers to help readers reference specific lines of code.

The Code block offers style variations to match your site’s design.
To access the Code block’s styles, follow these steps:
- Click on your Code block to select it.
- Open the block settings in the right sidebar.
- Click the Styles icon in the sidebar.
The Code block includes the following styles:
- Styles: Select Default, No highlight, Solarized Light, or Solarized Dark.
- Color: Click the ⋮ next to Color to select specific colors for different syntaxes.
- Typography options
- Dimensions settings
- Border settings
