|
/ Documentation /Developers Documentation/ Customize Maximum URL Slug Length surerank_url_length

Customize Maximum URL Slug Length surerank_url_length

Hook: surerank_url_length

Description: This filter allows you to define the maximum length (in characters) for the URL slug generated by SureRank. By default, SureRank limits the slug to a reasonable length to ensure optimal readability and SEO performance. You can override this limit using the filter.

Source: inc/functions/defaults.php

Usage: You can use this filter to change the maximum allowed slug length for post URLs. This applies when SureRank automatically generates or optimizes slugs.

Example:

PHP
// Filter to limit the SureRank URL slug length to 80 characters
add_filter( 'surerank_url_length', function() {
    return 80;
});

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