Knowledge BaseUltimate Markdown › Front Matter

Using Front Matter in the Plugin

The Front Matter feature of Ultimate Markdown allows you to configure a WordPress post by adding key-value pairs at the beginning of the Markdown file.

How Front Matter Works

Front Matter must be included at the beginning of the file and take the form of valid YAML set between triple-dashed lines.

In the following Markdown file, Front Matter is used to configure post title, post excerpt, and post status:

---
title: The post title
excerpt: The post excerpt
status: private
---

## First Heading

Paragraph Content.

Supported Keys

The plugin supports the following Front Matter keys:

KeyValueWordPress Post Setting
titleStringPost title
excerptStringPost excerpt
categoriesArray (An array of category IDs or category names)Post categories
tagsArray (An array of tag IDs or tag names)Post tags
authorString (The ID or login name of the author)Post author
dateString (The post date in the “YYYY-MM-DD hh:mm:ss” format) (E.g. 2022-04-16 10:30:42)Post date
statusString (The accepted values are: publish, future, draft, pending, private, trash)Post status
slugString (The last part of the URL)Permalink (slug)
thumbnailString (The thumbnail ID or the URL of a publicly available image. Note that when a publicly available image is specified, the plugin creates the corresponding image in the media library.) Featured image
thumbnail_altString (The alt text of the image uploaded in the media library. Note that this key is only used when a publicly available image is specified in the “thumbnail” key.) Feature image alt text
thumbnail_titleString (The title attribute of the image uploaded in the media library. Note that this key is only used when a publicly available image is specified in the “thumbnail” key.) Feature image title attribute

Examples

Set the Post Title

---
title: The post title
---

## First Heading

Paragraph Content.

Set the Post Excerpt

---
excerpt: The post excerpt
---

## First Heading

Paragraph Content.

Set Categories

---
categories:
  - Category 1
  - Category 2
---

## First Heading

Paragraph Content.

Set Tags

---
tags:
  - Tag 1
  - Tag 2
---

## First Heading

Paragraph Content.

Set Post Status

---
status: private
---

## First Heading

Paragraph Content.

Set Post Author

---
author: John Doe
---

## First Heading

Paragraph Content.

Set Post Date

---
date: 2022-04-16 10:30:42
---

## First Heading

Paragraph Content.

Complete Example Using All Supported Keys

---
title: The post title
excerpt: The post excerpt
categories:
  - Category 1
  - Category 2
tags:
  - Tag 1
  - Tag 2
author: John Doe
date: 2022-04-16 10:30:42
status: private
slug: my-first-article
thumbnail: https://example.com/laptop-computer.png
thumbnail_alt: Laptop computer displaying the logo of WordPress
thumbnail_title: WordPress is a free and open-source content management system written in PHP
---

## First Heading

Paragraph Content.

Common Issues

Front Matter may be ignored (fully or partially) in the following cases:

  • Invalid YAML syntax
  • Unsupported or misspelled keys
  • Incorrect value formats (e.g. invalid date or status)

Always validate your YAML structure carefully when troubleshooting.