Math block

Go back to the list of Blocks

The Math block lets you display mathematical notation in your content. You can enter formulas using LaTeX or MathML and show them as a standalone block or inline within text. Inline math formatting is also available in rich text fields such as Paragraphs, Headings, Lists, and Table cells.

Requirements

  • WordPress 6.9 or later.

Add a Math block

  1. Open a post or page in the editor.
  2. Place your cursor where you want the formula to appear.
  3. Open the Block Inserter (+) in the top toolbar, search for “Math,” and select the Math block.

You can also type /math in the block editor and press Enter.

Math block is highlighted in the modal that appears when typing the command forward slash and "math" in the block editor

Read detailed instructions on adding blocks.

Enter a formula

Example LaTeX formula
Example output of a LaTeX formula using the Math block
  1. Click inside the Math block to edit.
  2. Type or paste your formula using LaTeX (for example, \frac{a}{b}, E=mc^2, \int_0^\infty e^{-x} dx) or valid MathML markup.
  3. Exit the block to preview the rendered result in the editor.

Add inline math inside text

  1. Add or select a text block (for example, Paragraph, Heading, List item, or Table cell).
  2. Select the portion of text where the formula should appear.
  3. Use the Inline math formatting option in the text toolbar, then type or paste your LaTeX or MathML. The expression will render inline with your text.
Video demonstrating how to add a math equation inline with text in the Paragraph block

Block toolbar

Math block toolbar including transform, move, and more option controls.
Math block toolbar

Each block toolbar comes with different options that let you customize or modify the block in the editor. To view the Math block toolbar, select the block and it will show a list of toolbar options.

The Math block has the following options:

  • Transform to
  • Moving handles
  • More options

Transform to

Math block transform dropdown menu showing Columns, Group, and Details blocks.

The Transform to tool allows you to convert the Math block into the following blocks:

  • Columns
  • Group
  • Details

Moving handles

Move controls in the block toolbar

To move a Math block, select the block in the editor. Use the Move up or Move down arrows in the block toolbar to move it one position at a time.

You can also click and hold the Drag icon, which looks like six dots, to drag the block to a new location.

Get more information about moving a block within the editor.

More options

These controls give you the option to copy, duplicate, remove, lock, and other standard actions.

Read about these and other settings.

Block settings

  • Input format: Choose to enter your formula in LaTeX or MathML.
  • Display mode: Show the formula as a standalone block or inline (for short expressions within a sentence).

Advanced

  • HTML anchor: Add a unique anchor to link to this formula (for example, article#eq-quadratic).
  • Additional CSS class(es): Add classes for custom styling.

Demo

Tips

  • Use block display for large equations or multi-line expressions; use inline display for short formulas inside sentences.
  • Keep LaTeX simple and standard. Complex packages or custom macros may not be supported.
  • Prefer MathML output for improved accessibility where possible; include explanatory text nearby for readers using assistive technologies.
  • Save commonly used formulas as Patterns to reuse across posts.

Frequently asked questions

Which syntax should I use?

LaTeX is often easiest to type; MathML is a web standard that supports accessibility. The block supports both.

Can I number equations or add references?

WordPress 6.9 doesn’t include built-in equation numbering. You can add labels in surrounding text or use patterns to keep numbering consistent.

Can I use inline math everywhere text appears?

Inline math works in most rich text fields, including Paragraphs, Headings, Lists, and Table cells.

Troubleshooting

My formula isn’t rendering:

  • Check for typos or unmatched braces in LaTeX.
  • If using MathML, ensure tags are valid and properly nested.
  • Switch the input format in settings to match what you typed (LaTeX or MathML).

Characters are being escaped or removed:

  • Paste plain text (not rich text) to avoid hidden formatting.
  • In MathML, angle brackets and entity references must be valid HTML; ensure your content isn’t stripped by another plugin.

Changelog

  • Updated 2026-05-13 (props to @awetz583 @aialvi)
    • Added links to list of blocks, instructions on adding blocks, moving blocks, and more options settings.
    • Added screenshots for a LaTeX formula example, block toolbar options, transform to options, and moving handles.
    • Added video of how to add inline Math equations in the Paragraph block
  • Created 2025-12-02

Was this article helpful? How could it be improved?

First published

Last updated