Page Meta

Page Meta

Adds the ability to override the page meta title and add in meta descriptions and keywords for pages.

  • Almost active
    This plugin was not updated the last 4322 days ago.
  • This plugin is not tested with the last major release of WordPress
    Content for list item
  • There is no information available which PHP version this plugin requires
    The latest stable PHP 8.4.3 was released on 16 January 2025
  • No information about vulnerabilities and unfixed security issues is available.
    Content for list item

Ratings

3

Active installs

1K

Total Downloads

31K

Support Threads

0

Last updated

20 March 2013

Added

14 October 2009

Versions

96.76%3.24%
  • Version 1.5
  • Version other

Screenshots

The Page Meta panel displayed below the content editor.
Settings are managed via the Settings > Reading page.

About Page Meta

FAQ

What custom field names does it use?

The field names used are _pagemeta_title, _pagemeta_description and _pagemeta_keywords.

The underscore prefix prevents it from being displayed in the list of custom fields.

How do I output the custom title?

If a custom title is set for a post type, the plugin will automatically hook into the wp_title function to modify the output.

This uses the parameters passed via wp_title and will completely override the title.

You can customise the output further using the pagemeta_title filter, which uses the same parameters plus the original post title value.

In this example we prefix the original title to the custom title.

add_filter( 'pagemeta_title', function( $title, $sep, $seplocation, $original_title ) {
    return $original_title . $title;
}, 10, 4 );

Please refer to the Codex for further information on the add_filter.

Why are the meta tags not added to my pages?

This plugin makes use of the wp_head hook action, therefore in order for it to work there must be a call to wp_head in the current theme header file.

More information on this can be found in the WordPress Codex.

Can I modify which fields are shown?

Yes, as of version 1.5 you can modify which fields are used using the pagemeta_fields filter:

add_filter( 'pagemeta_fields', function( $fields ) {
    $fields['author'] = 'Author'; // Add a new field.
    unset( $fields['keywords'] ); // Remove a default field.
    return $fields;
} );

The default fields are ‘title’, ‘description’ and ‘keywords’.

Can I output the meta values?

The page meta values can be output within posts using the [postmeta] shortcode.

Passing through a name attribute will determine which value is returned, for example to output the description value use the following.

[postmeta name="description"]

Name values are determined by the fields set, by default these are ‘title’, ‘description’ and ‘keywords’.

To output meta values in template files, you can make use of the_pagemeta function.

<?php if ( function_exists( 'the_pagemeta' ) ) { the_pagemeta( 'description' ); } ?>

This will output the value, in order to return the value or lookup a specific post ID you can use get_the_pagemeta.

<?php if ( function_exists( 'get_the_pagemeta' ) ) { 
    $description = get_the_pagemeta( 'description' );
} ?>

<?php if ( function_exists( 'get_the_pagemeta' ) ) {
    $description = get_the_pagemeta(
        'description', // Page meta value name
        123 // Post ID to lookup
    );
} ?>

Not that these functions will return the raw values prior to any output manipulation.

Changelog

1.5

1.5

1.4.1

1.4

1.3

1.2

1.1

1.0

0.3.1

0.3

0.2.1

0.2

0.1

How to install Page Meta

Here we go:

  1. Upload the pagemeta folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Choose which post types the plugin should be enabled on via the Settings > Reading options.