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
- Open a post or page in the editor.
- Place your cursor where you want the formula to appear.
- Open the block inserter (+), search for “Math,” and select Math.
Enter a formula
- Click inside the Math block to edit.
- 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. - Exit the block to preview the rendered result in the editor.
Add inline math inside text
- Add or select a text block (for example, Paragraph, Heading, List item, or Table cell).
- Select the portion of text where the formula should appear.
- 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.
Block toolbar
- Alignment: Align the formula left, center, or right.
- Move/drag: Reposition the block within your content.
- More options: Duplicate, lock, remove, and other standard actions.
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
- Created 2025-12-02
Was this article helpful? How could it be improved?
Log in to submit feedback. If you need support with something that wasn't covered by this article, please post your question in the support forums.