WordPress.org

Plugin Directory

Single Category Permalink

Reduce permalinks (category or post) that include entire hierarchy of categories to just having the lowest level category.

Filters

The plugin exposes one filter for hooking. Typically, customizations utilizing this hook would be put into your active theme's functions.php file, or used by another plugin.

c2c_single_category_redirect_status (filter)

The 'c2c_single_category_redirect_status' hook allows you to specify an HTTP status code used for the redirect. By default this is 302.

Arguments:

  • $status (integer) : The default HTTP status code

Example:

// Change single category redirect to 301
/**
 * Change the redirection HTTP status to a 301.
 *
 * @param int $code The HTTP status code. By default 302.
 * @return int
 */
function scp_change_redirect_status( $code ) {
    return 301;
}
add_filter( 'c2c_single_category_redirect_status', 'scp_change_redirect_status' );

Requires: 1.5 or higher
Compatible up to: 4.5.3
Last Updated: 3 months ago
Active Installs: 1,000+

Ratings

5 out of 5 stars

Support

0 of 2 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
0,1,0
0,1,0
100,1,1
0,1,0