---
title: "Full Page HTML Plugin"
description: "Edit metadata and document properties including title, keywords, and description via a dialog box, with HTML structure exposure in source code view."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/fullpagehtml/"
md_url: "https://www.tiny.cloud/docs/tinymce/latest/fullpagehtml/index.md"
version: "latest"
last_updated: "2026-04-29T05:31:25Z"
tokens: 2745
---
# Full Page HTML Plugin

> **Note:** This plugin is only available for [paid TinyMCE subscriptions](/pricing/).

> **Note:** This feature is not supported when TinyMCE is run in *inline* mode. It is only supported in *classic* mode. For more information on the differences between the editing modes, see [Inline editing mode](../use-tinymce-inline/).
The Full Page HTML plugin provides comprehensive control over document metadata and properties. It enables users to edit HTML document metadata such as title, keywords, and description through an intuitive dialog interface. When combined with the code plugin, it also exposes the complete HTML structure including `<head>`, `<body>`, and various meta tags in the source code view.

## Interactive example

**Example**

```js
tinymce.init({
  selector: 'textarea#fullpagehtml',
  height: '800px',
  plugins: [
    "fullpagehtml", "advlist", "anchor", "autolink", "charmap", "code", "fullscreen",
    "help", "image", "insertdatetime", "link", "lists", "media",
    "preview", "searchreplace", "table", "visualblocks",
  ],
  toolbar: "fullpagehtml | undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
  // Full Page HTML Plugin Configuration Options
  fullpagehtml_default_doctype: '<!DOCTYPE html>',
  fullpagehtml_default_title: 'Full Page HTML Plugin Demo Document',
  fullpagehtml_default_encoding: 'UTF-8',
  fullpagehtml_default_body_style: 'margin: 20px; padding: 15px; font-family: Georgia, Times, serif; font-size: 16px; color: #2c3e50;',
  fullpagehtml_hide_in_source_view: false  // Show full page HTML in source view
});
```

## Basic setup

To add the Full Page HTML plugin to the editor, add `fullpagehtml` to the `plugins` option in the editor configuration.

For example:

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'fullpagehtml',
  toolbar: 'fullpagehtml',
  fullpagehtml_default_doctype: '<!DOCTYPE html>'
});
```

> **Note:** For information on bundling this plugin with module bundlers, see [Bundling TinyMCE - Overview](../bundling-guide/).

> **Warning:** **Certain elements may be removed by XSS sanitization** By default, TinyMCE sanitizes HTML content to protect against XSS attacks. Elements outside the HTML5 specification, such as `<script>`, are removed unless explicitly allowed through [`valid_elements`](../content-filtering/#valid_elements) or [`extended_valid_elements`](../content-filtering/#extended_valid_elements). Standard `<meta>` tags are preserved, but attributes not defined in the HTML5 spec (for example, the RDFa `property` attribute) require explicit configuration to be retained.
> 
> If integrators encounter issues with required elements being removed, the following configuration options are available. These options reduce security and should be used with caution:
> 
> - `xss_sanitization: false` — Disables DOMPurify and removes all XSS protections.
> - `valid_elements: '*[*]'` — Allows all elements and attributes.
> - `extended_valid_elements: 'meta[*]'` — Extends the schema to allow additional `<meta>` attributes (for example, RDFa `property`).
> Note that `extended_valid_elements` is **additive**, so all standard elements and attributes remain valid while additional ones are permitted.
> 
> For more details, see [xss_sanitization option](../security/#xss_sanitization-option) and [valid_elements option](../content-filtering/#valid_elements).
> 
> Example: disabling DOMPurify with `xss_sanitization`
> ```js
> tinymce.init({
> selector: 'textarea',
> plugins: 'fullpagehtml',
> toolbar: 'fullpagehtml',
> xss_sanitization: false  // Disables TinyMCE's built-in XSS sanitization; allows potentially unsafe HTML
> });
> ```
> Example: allowing all elements and attributes with `valid_elements`
> ```js
> tinymce.init({
> selector: 'textarea',
> plugins: 'fullpagehtml',
> toolbar: 'fullpagehtml',
> valid_elements: '*[*]'  // Permits all elements and attributes; use with extreme caution
> });
> ```
> Example: extending `<meta>` support with `extended_valid_elements`
> ```js
> tinymce.init({
> selector: 'textarea',
> plugins: 'fullpagehtml',
> toolbar: 'fullpagehtml',
> extended_valid_elements: 'meta[*]'  // Permits additional <meta> attributes (such as RDFa property)
> });
> ```
> Support for the RDFa `property` attribute on `<meta>` elements is planned for inclusion in the default TinyMCE schema in future releases. If you require this attribute now, use `extended_valid_elements` as shown above.

> **Note:** **Incompatibility with Suggested Edits and Revision History**
> 
> The Full Page HTML plugin is not compatible with the Suggested Edits and Revision History plugins. Document properties and metadata set by the Full Page HTML plugin are not currently preserved when using these collaboration features, and may be lost during the review process.
> 
> **Recommendation:** Avoid using the Full Page HTML plugin in combination with Suggested Edits or Revision History plugins to prevent data loss of document metadata and properties at this current time until this issue is resolved.

## Options

The following configuration options affect the behavior of the Full Page HTML plugin.

### `fullpagehtml_default_doctype`

This option enables you to specify the default doctype for the output HTML.

**Type:** `String`

**Possible values:** `'<!DOCTYPE html>'`

**Default value:** `'<!DOCTYPE html>'`

#### Example: using `fullpagehtml_default_doctype`

```js
tinymce.init({
  selector: 'textarea',
  plugins: 'fullpagehtml',
  fullpagehtml_default_doctype: '<!DOCTYPE html>'
});
```

### `fullpagehtml_default_title`

This option enables you to specify the default title for the output HTML.

**Type:** `String`

**Possible values:** Any string value representing the document title

**Default value:** No default value (empty string)

#### Example: using `fullpagehtml_default_title`

```js
tinymce.init({
  selector: 'textarea',
  plugins: 'fullpagehtml',
  fullpagehtml_default_title: 'My default page title'
});
```

### `fullpagehtml_default_encoding`

This option enables you to specify the default encoding for the output HTML.

**Type:** `String`

**Possible values:** Any string value representing a character encoding

**Default value:** No default value (empty string)

#### Example: using `fullpagehtml_default_encoding`

```js
tinymce.init({
  selector: 'textarea',
  plugins: 'fullpagehtml',
  fullpagehtml_default_encoding: 'ISO-8859-1'
});
```

### `fullpagehtml_default_body_style`

This option enables you to specify the default body style for the output HTML.

**Type:** `String`

**Possible values:** Any string value representing valid CSS styles

**Default value:** No default value (empty string)

#### Example: using `fullpagehtml_default_body_style`

```js
tinymce.init({
  selector: 'textarea',
  plugins: 'fullpagehtml',
  fullpagehtml_default_body_style: 'margin: 20px; padding: 10px; font-family: Arial, sans-serif;'
});
```

### `fullpagehtml_hide_in_source_view`

This option enables you to control whether the full page HTML structure is hidden in source code view.

**Type:** `Boolean`

**Possible values:** `true` or `false`

**Default value:** `false`

#### Example: using `fullpagehtml_hide_in_source_view`

```js
tinymce.init({
  selector: 'textarea',
  plugins: 'fullpagehtml',
  fullpagehtml_hide_in_source_view: true
});
```
When `fullpagehtml_hide_in_source_view` is set to `true`, the source code view will show only the body content without the full HTML document structure:

Example
```html
<h1>Welcome to Our Website</h1>
<p>This is the main content area where users can edit text, add images, and format their content.</p>
<ul>
  <li>First bullet point</li>
  <li>Second bullet point</li>
</ul>
```
When set to `false` (default), the source code view shows the complete HTML document:

Example
```html
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>Full Page HTML Plugin Demo Document</title>
</head>
<body style="margin: 20px; padding: 15px; font-family: Georgia, Times, serif; font-size: 16px; color: #2c3e50;">
  <h1>Welcome to Our Website</h1>
  <p>This is the main content area where users can edit text, add images, and format their content.</p>
  <ul>
    <li>First bullet point</li>
    <li>Second bullet point</li>
  </ul>
</body>
</html>
```

### `fullpagehtml` option for `getContent()` and `setContent()`

When the Full Page HTML plugin is active, `editor.getContent()` and `editor.setContent()` return and accept the full HTML document by default. The `fullpagehtml` option allows getting and setting only the body content when needed.

Pass `fullpagehtml: false` in the options object to bypass full-page processing and work with body content only:

- `editor.getContent({ fullpagehtml: false })` — Returns only the `<body>` content.
- `editor.setContent(content, { fullpagehtml: false })` — Sets only the body content without modifying the document head.

This option is useful when saving or loading body content separately (for example, when storing content in a database or when integrating with systems that expect body-only HTML). Unlike `fullpagehtml_hide_in_source_view`, which affects only the source code view display, the `fullpagehtml` option affects API behavior and requires no configuration.

#### Example: getting and setting body content

```js
// Get only the body content for saving
const bodyContent = editor.getContent({ fullpagehtml: false });

// Set only the body content (preserves document head)
editor.setContent(newBodyContent, { format: 'html', fullpagehtml: false });
```

## Toolbar buttons

The Full Page HTML plugin provides the following toolbar buttons:

| Toolbar button identifier | Description |
| --- | --- |
| `fullpagehtml` | Opens the Full Page HTML dialog to edit document metadata and properties including title, keywords, description, and HTML structure settings. |

These toolbar buttons can be added to the editor using:

- The [`toolbar`](../toolbar-configuration-options/#toolbar) configuration option.
- The [`quickbars_insert_toolbar`](../quickbars/#quickbars_insert_toolbar) configuration option.
- [Custom Context toolbars](../contexttoolbar/).

| Toolbar button identifier | Description |
| --- | --- |
| `fullpagehtml` | Opens the Full Page HTML dialog to edit document metadata and properties including title, keywords, description, and HTML structure settings. |

## Menu items

The Full Page HTML plugin provides the following menu items:

| Menu item identifier | [Default Menu Location](../menus-configuration-options/#example-the-tinymce-default-menu-items) | Description |
| --- | --- | --- |
| `fullpagehtml` | File | Opens the Full Page HTML dialog to edit document metadata and properties including title, keywords, description, and HTML structure settings. |

These menu items can be added to the editor using:

- The [`menu`](../menus-configuration-options/#menu) configuration option.
- The [`contextmenu`](../menus-configuration-options/#contextmenu) configuration option.
- [Custom Menu toolbar buttons](../custom-menu-toolbar-button/).

| Menu item identifier | [Default Menu Location](../menus-configuration-options/#example-the-tinymce-default-menu-items) | Description |
| --- | --- | --- |
| `fullpagehtml` | File | Opens the Full Page HTML dialog to edit document metadata and properties including title, keywords, description, and HTML structure settings. |

## Commands

The Full Page HTML plugin provides the following TinyMCE command.

| Command | Description |
| --- | --- |
| mceFullPageHtmlProperties | Opens the Full Page HTML dialog to edit document metadata and properties including title, keywords, description, and HTML structure settings. |

Example
```js
tinymce.activeEditor.execCommand('mceFullPageHtmlProperties');
```
