|
/ Documentation /Developers Documentation/ Customize Meta Description Length surerank_description_length

Customize Meta Description Length surerank_description_length

Hook: surerank_description_length

Description: This filter allows you to customize the maximum length (in characters) of the meta description generated by SureRank. By default, SureRank limits the meta description to a standard length, but you can override it to better suit your SEO strategy or content type.

Source: inc/functions/defaults.php

Accepted Value: int — Desired maximum length of the meta description in characters.

Example:

PHP
// Change the maximum meta description length in SureRank (default is 155)
add_filter( 'surerank_description_length', function() {
    return 160; // Sets the max meta description length to 160 characters
});

You can add the example code to your child theme’s functions.php file or use a plugin like Code Snippets to safely insert custom code. Using a code snippet plugin is recommended for easier management and to ensure the code remains active even if you switch themes.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page
Scroll to Top