WP Subtitle


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.

<?php the_subtitle(); ?> is used for inside The Loop. If you wish to get a page/post's subtitle outside The Loop, use `<?php get_the_subtitle( $post ); ?>`, where $post is a post object or ID ($post->ID).


Just like WP’s built-in <?php the_title(); ?> method, <?php the_subtitle(); ?> tag accepts three parameters:

(string) Text to place before the subtitle. Defaults to “”.

(string) Text to place after the subtitle. Defaults to “”.

(boolean) If true, display the subtitle in HTML. If false, return the subtitle for use in PHP. Defaults to true.

Things are slightly different in <?php get_the_subtitle(); ?>:

(int|object) Post, page or custom post type object or ID.

(string) Text to place before the subtitle. Defaults to “”.

(string) Text to place after the subtitle. Defaults to “”.

(boolean) If true, display the subtitle in HTML. If false, return the subtitle for use in PHP. Defaults to true.

For full details on the template tags and their arguments, view the documentation here.

By default, subtitle are supported by both posts and pages. To add support for custom post types use add_post_type_support( ‘my_post_type’, ‘wps_subtitle’ ).

Tangkapan Layar

  • 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


  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. Edit your page and/or post template and use the <?php the_subtitle(); ?> template tag where you’d like the subtitle to appear.

For full details on the template tags and their arguments, view the documentation here.


What does WP Subtitle do?

The plugin adds a Subtitle field when editing posts or pages. The subtitle is stores as a custom field (post meta data) and can be output using template tags.

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.

How do I add support for custom post types?

To add support for custom post types use add_post_type_support( ‘my_post_type’, ‘wps_subtitle’ ):

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 forum.

How should I report a bug?

Please submit bugs/errors directly to the GitHub Issues list.

How can I contribute code?

The plugin is hosted on GitHub and pull requests are welcome.


Juni 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
Maret 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 😉 )
Baca semua 19 tinjauan

Kontributor & Pengembang

“WP Subtitle” adalah perangkat lunak sumber terbuka. Berikut ini mereka yang sudah berkontribusi pada plugin ini.

Para Kontributor

“WP Subtitle” telah diterjemahkan kedalam 4 lokale. Terima kasih kepada para penerjemah untuk kontribusi-nya.

Terjemahkan “WP Subtitle” dalam bahasa Anda.

Tertarik mengembangkan?

Lihat kode, periksa repositori SVN , atau mendaftar ke log pengembangan melalui RSS.

Log Perubahan



  • Fix WordPress 5.0 compatibility – check use_block_editor_for_post_type.


  • 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.


  • Make wps_subtitle available via WordPress REST API.


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


  • Add support for post revisions. Props Fabian Marz.
  • As of WordPress 4.3 no need to esc_attr() AND htmlentities() – can mess up special characters.


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


  • 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.


  • Fix incorrect post ID reference preventing subtitle from saving.


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


  • Security Update: Sanitize $_REQUEST and $_GET when establishing post type in the admin.
  • Added quick edit support for subtitle. Props Fabian Marz and sun.
  • Allow subtitle post meta key to be filtered using wps_subtitle_key.
  • Add German translation. Props hatsumatsu.


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


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


  • Add subtitle admin column.


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


  • Security Update: Ensure subtitles are sanitized when saving.


  • 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.


  • 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)


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


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


  • 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.


  • First version.