• Resolved peterpruimboom

    (@peterpruimboom)


    Hello,

    I’ve searched the documentation and could not find a way to limit the generated description length to for example 150 characters. Maybe I’ve overlooked it but does anyone know if and how it could be done?

    Thanks in advance, Peter

Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi Peter,

    You can adjust the recommendations by filtering the_seo_framework_input_guidelines.

    For your request you’d want to filter [description][search][chars][goodUpper]. For example:

    add_filter(
    	'the_seo_framework_input_guidelines',
    	function( $guidelines ) {
    
    		$guidelines['description']['search']['chars']['goodUpper'] = 150;
    
    		return $guidelines;
    	}
    );

    Code reference: https://github.com/sybrew/the-seo-framework/blob/4.2.5/inc/classes/admin-init.class.php#L227-L296

    Some details:
    The default [description][search][chars][goodUpper] value is 160 x language character calibration.

    (I’m presuming your languages of interest by name, excuse me if I’m mistaken.) No calibration is necessary for Dutch, French, and English (so it’s just 160). German’s character calibration value is 0.9875 because they capitalize nouns mid-sentence (so that equates to 158).

    You can ignore this calibration entirely if you do not care for Google. Otherwise, in a future update, the calibration values are passed to the filter to use directly.

    I hope this helps ?? Cheers!

Viewing 1 replies (of 1 total)
  • The topic ‘Generated Description Length’ is closed to new replies.