Title: WP Subtitle
Author: husani
Published: <strong>July 9, 2009</strong>
Last modified: March 5, 2026

---

Search plugins

![](https://ps.w.org/wp-subtitle/assets/banner-772x250.png?rev=981565)

![](https://ps.w.org/wp-subtitle/assets/icon-256x256.png?rev=981565)

# WP Subtitle

 By [husani](https://profiles.wordpress.org/husani/)

[Download](https://downloads.wordpress.org/plugin/wp-subtitle.3.4.2.zip)

 * [Details](https://sa.wordpress.org/plugins/wp-subtitle/#description)
 * [Reviews](https://sa.wordpress.org/plugins/wp-subtitle/#reviews)
 *  [Installation](https://sa.wordpress.org/plugins/wp-subtitle/#installation)
 * [Development](https://sa.wordpress.org/plugins/wp-subtitle/#developers)

 [Support](https://wordpress.org/support/plugin/wp-subtitle/)

## Description

The WP Subtitle plugin allows your pages and posts to contain a subtitle. Also called
a sub-heading, this this short line of text is meant to appear beneath a post’s (
or page’s) title, but can be inserted in your template wherever you choose.

The subtitle can be inserted into your theme template files (or plugin) using the
following API:

#### Display The Subtitle

All parameters are optional. If ‘post_id’ is omitted then the current post ID in
the loop is used.

PHP Code:

    ```
    do_action( 'plugins/wp_subtitle/the_subtitle', array(
        'before'        => '<p class="subtitle">',
        'after'         => '</p>',
        'post_id'       => get_the_ID(),
        'default_value' => ''
    ) );
    ```

Output:

    ```
    <p class="subtitle">My Post Subtitle</p>
    ```

#### Get The Subtitle

All parameters are optional. If ‘post_id’ is omitted then the current post ID in
the loop is used.

A default value can be supplied as the second parameter for `apply_filters`. This
will be used if the post does not have a subtitle. Leave as an empty string to return
an empty string if the post does not have a subtitle.

PHP Code:

    ```
    $subtitle = apply_filters( 'plugins/wp_subtitle/get_subtitle', '', array(
        'before'  => '<p class="subtitle">',
        'after'   => '</p>',
        'post_id' => get_the_ID()
    ) );
    ```

Result:

    ```
    $subtitle = '<p class="subtitle">My Post Subtitle</p>'
    ```

#### Parameters

The array of arguments accepted for the `plugins/wp_subtitle/the_subtitle` action
and `plugins/wp_subtitle/get_subtitle` filter are:

**before**
 _(string)_ Text to place before the subtitle if one exists. Defaults
to an empty string.

**after**
 _(string)_ Text to place after the subtitle if one exists. Defaults to
to an empty string.

**post_id**
 _(integer)_ Post, page or custom post type ID.

**default_value**
 _(string)_ Only used by the `plugins/wp_subtitle/the_subtitle`
action, allows you to specify a default subtitle to display if the post does not
have one. For the `plugins/wp_subtitle/get_subtitle` filter the second parameter
of `apply_filters` should be used instead. Defaults to to an empty string.

#### Post Type Support

By default, subtitle are supported by both posts and pages. To add support for custom
post types add teh following to your theme functions file or plugin:

    ```
    add_post_type_support( 'my_post_type', 'wps_subtitle' )
    ```

#### WooCommerce Plugin Support

Subtitles can automatically be added to your WooCommerce products without needing
to make template changes. In the admin go to WooCommerce > Settings > Products where
you can choose to:

 * Enable Product Subtitles
 * Display the subtitle on single product pages
 * Display the subtitle on product archives (category pages)

#### Yoast SEO and SEOPress Plugin Support

The plugin allows you to include the subtitle in your meta titles and descriptions
via the [Yoast SEO](https://wordpress.org/plugins/wordpress-seo/) and [SEOPress](https://wordpress.org/plugins/wp-seopress/)
plugins.

Similar to the Yoast `%%title%%` placeholder which inserts the post title, you can
use `%%wps_subtitle%%`.

There are also addition placeholders and filters to allow to to customize seperators
for the subtitle.

For more information, [view the SEO support documentation here](https://github.com/benhuson/wp-subtitle/wiki/Yoast-SEO-Plugin-Support).

## Screenshots

 * [[
 * Edit post screen (WordPress 5.0+ and WP Title 3.1+)
 * [[
 * Edit post screen (WordPress 3.5+ and WP Title 2.2+)
 * [[
 * Edit post screen (for earlier versions of WordPress or using the ‘wps_subtitle_use_meta_box’
   filter)
 * [[
 * A single page showing a subtitle

## Installation

 1. Upload the WP Subtitle plugin to your WordPress site in the `/wp-content/plugins`
    folder or install via the WordPress admin.
 2. Activate it from the WordPress plugin admin screen.
 3. Use the API to display the subtitle in your theme.

For full details on the API and how to display the subtitle, [view the documentation here](https://github.com/benhuson/wp-subtitle/wiki).

## FAQ

### What does WP Subtitle do?

The plugin adds a Subtitle field when editing posts, pages or custom post types.
The subtitle is stored as a custom field (post meta data) and can be output using
API actions and filters.

### Where does WP Subtitle store the subtitles?

All subtitles are stored as post meta data. Deactivating this plugin will not remove
those fields.

### Compatibility with WordPress 5.0+

In the new editor in WordPress 5.0 the subtitle is editable via ap panel in the 
sidebar (like excerpts).

### How do I add the subtitle to my pages?

Refer to [the documentation](https://github.com/benhuson/wp-subtitle/wiki).

### How do I add support for custom post types?

To add support for custom post types add the following to your theme functions file
or plugin:

    ```
    function my_wp_subtitle_page_part_support() {
        add_post_type_support( 'my_post_type', 'wps_subtitle' );
    }
    add_action( 'init', 'my_wp_subtitle_page_part_support' );
    ```

### Where can I get help?

Please post support requests and questions in the [WordPress.org Support](https://wordpress.org/support/plugin/wp-subtitle)
forum.

### How should I report a bug?

Please submit bugs/errors directly to the [GitHub Issues](https://github.com/benhuson/wp-subtitle/issues)
list.

### How can I contribute code?

The plugin is [hosted on GitHub](https://github.com/benhuson/wp-subtitle) and pull
requests are welcome.

## Reviews

![](https://secure.gravatar.com/avatar/a8afc1f3d1a7d4c87966441d41f480ea9b12be4273e7b880712a960d8b129ece?
s=60&d=retro&r=g)

### 󠀁[Not well integrated](https://wordpress.org/support/topic/not-well-integrated/)󠁿

 [jzwolak](https://profiles.wordpress.org/jzwolak/) April 25, 2020

I cannot even say for sure that this plugin works. The UI requires entering the 
subtitle in the right side panel and not inline with the post text where I’d expect
it. I took 10-15 minutes just to discover this. Then I tried to preview the post
to see if the subtitle rendered and it did not. So the only way to know if this 
plugin is working is to publish a post. I refuse to publish a post to verify the
plugin works. The plugin should display the subtitle in the preview and ideally 
in the post editor. I’m using Wordpress 5.3.2 (which is the latest verified working
version with this plugin at the time of this writing). Reading over the description
of the plugin, it appears that I must edit the theme. I’m not going to do that either.
There must be a better way to add subtitles.

![](https://secure.gravatar.com/avatar/100d63c0fa2df3cd1337a7ba29958513e2f8df650539cb249fdcb054ddf64f14?
s=60&d=retro&r=g)

### 󠀁[I Wish I Could Give 10 Stars](https://wordpress.org/support/topic/i-wish-i-could-give-10-stars/)󠁿

 [iSaumya](https://profiles.wordpress.org/isaumya/) April 9, 2020

I found this plugin when developing a theme where I needed to show the subtitle 
below the title of the page/post/CPT. Now I saw many reviews saying what’s the point
of this plugin or this is not a plug-n-play plugin etc. and I would like those people
to say, trust me, guys, you have no development experience whatsoever, otherwise
you would have understood the importance of the plugin and thanked that it is not
a plug-n-play plugin which gives you full control over how you wanna show, where
you wanna show and styling. When Gutenberg was in beta it has the subheading block
built-in, but then it did not get released. What a shame! Anyways, I initially thought
that I will create a custom Gutenberg Block myself for the subheading, but I quickly
saw that any block you make will be shown inside the the_content(); section. Which
didn’t worked for me as I wanted it outside of the content so that I can place it
below the title and show where I want it to be shown. Also, you can easily add the
subtitle support to your CPT which is truly awesome. Again, I will highly recommend
this plugin and I would have given 10 stars if it was possible. I just hope that
the plugin developer maintains the plugin in future and not leave it in the middle
as this is truly an amazing plugin which I would hate to see die.

![](https://secure.gravatar.com/avatar/11db9d5d8ccd7c81deb4b056d05cdab931b98968d397690fc7a105316f1c6c1b?
s=60&d=retro&r=g)

### 󠀁[Works well with WP-5.2 and PHP-7.1](https://wordpress.org/support/topic/works-well-with-wp-5-2-and-php-7-1/)󠁿

 [antonv](https://profiles.wordpress.org/antonv/) June 14, 2019

Does what it advertises efficiently. I give it 4-stars as it needs a bit of development
support on the theme templates to display the subtitles — not quite plug-and-play

![](https://secure.gravatar.com/avatar/d85073eadf8cea570d7790f9b9de5d54bbe9bec9efede3021c2bca6cd938158e?
s=60&d=retro&r=g)

### 󠀁[Fatal error triggered](https://wordpress.org/support/topic/fatal-error-triggered-3/)󠁿

 [stephcthomp](https://profiles.wordpress.org/stephcthomp/) January 24, 2019

Sorry, cannot activate this plugin in WP 5.03 as it triggers a fatal error.

![](https://secure.gravatar.com/avatar/fc86d9dfbfc88c36be834763e00759fcd59197dee28515e1e4c85204c3abe013?
s=60&d=retro&r=g)

### 󠀁[Development](https://wordpress.org/support/topic/development-12/)󠁿

 [wellbeingtips](https://profiles.wordpress.org/wellbeingtips/) September 3, 2018

The development of this plugin follows the WordPress future.

![](https://secure.gravatar.com/avatar/62518f7f6d09f4f8433e6fc539cf6c8e182328ce8dffba427217ecc43919b245?
s=60&d=retro&r=g)

### 󠀁[Works as intended!](https://wordpress.org/support/topic/works-as-intended-96/)󠁿

 [surml](https://profiles.wordpress.org/surml/) March 27, 2018

Thank you very much for that plugin. It works perfectly in multiple of my clients
installations. For the fifth star: It would be very convenient (for me) to have 
the default behaviour of get_the_subtitle() changed to return the content rather
than echo it. 1. It would go along with the behaviour of Wordpress built-in functions(
get_the_title(), get_the_content() etc.) 2. I have to provide 3 extra paramters (
$before, $after and $echo ) everytime I want to do this simple switch. Another suggestion
would be to check if $post is already set and use it automatically if so. (That 
way i wouldnt have to use any params at all in most of my use-cases. …and YES, I
am lazy 😉 )

 [ Read all 21 reviews ](https://wordpress.org/support/plugin/wp-subtitle/reviews/)

## Contributors & Developers

“WP Subtitle” is open source software. The following people have contributed to 
this plugin.

Contributors

 *   [ husani ](https://profiles.wordpress.org/husani/)
 *   [ Ben Huson ](https://profiles.wordpress.org/husobj/)

“WP Subtitle” has been translated into 5 locales. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/wp-subtitle/contributors)
for their contributions.

[Translate “WP Subtitle” into your language.](https://translate.wordpress.org/projects/wp-plugins/wp-subtitle)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/wp-subtitle/), check
out the [SVN repository](https://plugins.svn.wordpress.org/wp-subtitle/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/wp-subtitle/) by
[RSS](https://plugins.trac.wordpress.org/log/wp-subtitle/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 3.4.2

 * Resolve XSS issue – standardized santitization throughout plugin.
 * Fixed issue with autosave and preview.
 * Confirmed WordPress 6.9 compatibility.

#### 3.4.1

 * Security: Resolve XSS issue by improving sanitization when saving subtitle custom
   field.
 * Pass the current post object to the `wps_subtitle_field_placeholder` filter. 
   Props [Dominik Schilling](https://github.com/ocean90).

#### 3.4

 * Added support for the SEOPress plugin. Props @chriselkins.
 * You can now update the subtitle via the REST API. Props @chriselkins.

#### 3.3.1

 * Fixed broken closing H2 tag for WooCommerce subtitle. Props @faktorvier.

#### 3.3

 * New API for displaying the subtitle using `do_action( 'plugins/wp_subtitle/the_subtitle')`.
 * New API for getting the subtitle using `apply_filters( 'plugins/wp_subtitle/get_subtitle','')`.
 * Admin column title now matches the meta box title if altered using the `wps_meta_box_title`
   filter.

#### 3.2

 * Fix WordPress 5.0 compatibility – check `use_block_editor_for_post_type`.

#### 3.1

 * Added `%%wps_subtitle%%` placeholders for Yoast SEO compatibility.
 * WooCommerce compatibility. Go to `WooCommerce > Settings > Products > Display`
   for settings.
 * Added `wps_subtitle_field_position` filter to show subtitle admin field `before_title`,`
   after_title` or in meta box.
 * Use metabox UI if editing in Gutenberg.

#### 3.0

 * Make `wps_subtitle` available via WordPress REST API.

#### 2.9.1

 * Fix preview not rendering correct template and other post meta.

#### 2.9

 * Add support for post revisions. Props [Fabian Marz](https://github.com/fabianmarz).
 * As of WordPress 4.3 no need to `esc_attr()` AND `htmlentities()` – can mess up
   special characters.

#### 2.8.1

 * Fix PHP warning – `get_admin_subtitle_value()` should be declared static.

#### 2.8

 * Allow subtitle to contain HTML (same as main post title ).
 * Add `wps_default_subtitle` filter.
 * Use `WP_Subtitle` class to validate saving of subtitle in the admin.

#### 2.7.1

 * Fix incorrect post ID reference preventing subtitle from saving.

#### 2.7

 * Trim subtitle by default.
 * Apply wptexturize() on subtitle.
 * Use WP_Subtitle class to manage post subtitle.

#### 2.6

 * Security Update: Sanitize `$_REQUEST` and `$_GET` when establishing post type
   in the admin.
 * Added quick edit support for subtitle. Props [Fabian Marz](https://github.com/fabianmarz)
   and [sun](https://github.com/sun).
 * Allow subtitle post meta key to be filtered using `wps_subtitle_key`.
 * Add German translation. Props [hatsumatsu](https://github.com/hatsumatsu).

#### 2.5

 * Add [wp_subtitle] shortcode.
 * Do not use variable for textdomain – causes issues for parsers.
 * Declare methods as public or private.

#### 2.4.1

 * Fix PHP notice warning on 404 error page. Props Jay Williams.
 * Add a little space above subtitle field when below title field in admin.

#### 2.4

 * Add subtitle admin column.

#### 2.3.2

 * Show subtitle admin field when adding new post. Props Gabriel Doty.

#### 2.3.1

 * Security Update: Ensure subtitles are sanitized when saving.

#### 2.3

 * Prevent subtitle fields from displaying on post types for which support has not
   been added using add_post_type_support(). Previously the fields were displayed
   but the subtitle would not be saved.
 * Escape subtitle admin field value – fixes issues with subtitles with quotes.

#### 2.2

 * Added ‘wps_subtitle_use_meta_box’ filter to allow the edit field to be displayed
   in a meta box (the old way).
 * Moved subtitle field from meta box to below title field in WordPress 3.5+ (props
   Tor Morten)

#### 2.1

 * Ready for translation – .pot file added.
 * Added deprecated function warnings if WP_DEBUG enabled.
 * Fix static method warnings.
 * Only include admin functionality when needed.

#### 2.0.1

 * Use `<?php` instead of just `<?`.
 * Break out some of the code into separate functions.

#### 2.0

 * Added custom post type support – use add_post_type_support( ‘{post_type}’, ‘wps_subtitle’).
 * Added ‘wps_meta_box_title’ filter.
 * Added ‘wps_subtitle’ filter.
 * Added ‘wps_subtitle_field_description’ filter.
 * Fixed bug in more recent versions of WordPress.

#### 1.0

 * First version.

## Meta

 *  Version **3.4.2**
 *  Last updated **1 month ago**
 *  Active installations **10,000+**
 *  WordPress version ** 5.6 or higher **
 *  Tested up to **6.9.4**
 *  PHP version ** 5.6 or higher **
 *  Languages
 * [English (US)](https://wordpress.org/plugins/wp-subtitle/), [German](https://de.wordpress.org/plugins/wp-subtitle/),
   [Polish](https://pl.wordpress.org/plugins/wp-subtitle/), [Portuguese (Brazil)](https://br.wordpress.org/plugins/wp-subtitle/),
   [Spanish (Chile)](https://cl.wordpress.org/plugins/wp-subtitle/), and [Spanish (Spain)](https://es.wordpress.org/plugins/wp-subtitle/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/wp-subtitle)
 * Tags
 * [content](https://sa.wordpress.org/plugins/tags/content/)[subhead](https://sa.wordpress.org/plugins/tags/subhead/)
   [subheading](https://sa.wordpress.org/plugins/tags/subheading/)[subtitle](https://sa.wordpress.org/plugins/tags/subtitle/)
   [title](https://sa.wordpress.org/plugins/tags/title/)
 *  [Advanced View](https://sa.wordpress.org/plugins/wp-subtitle/advanced/)

## Ratings

 4.1 out of 5 stars.

 *  [  13 5-star reviews     ](https://wordpress.org/support/plugin/wp-subtitle/reviews/?filter=5)
 *  [  4 4-star reviews     ](https://wordpress.org/support/plugin/wp-subtitle/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/wp-subtitle/reviews/?filter=3)
 *  [  2 2-star reviews     ](https://wordpress.org/support/plugin/wp-subtitle/reviews/?filter=2)
 *  [  2 1-star reviews     ](https://wordpress.org/support/plugin/wp-subtitle/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-subtitle/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/wp-subtitle/reviews/)

## Contributors

 *   [ husani ](https://profiles.wordpress.org/husani/)
 *   [ Ben Huson ](https://profiles.wordpress.org/husobj/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/wp-subtitle/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SLZUF4XJTS4E6)