Length of meta description

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
roschi
Posts: 9
Joined: Mon Nov 14, 2016 12:02 pm

Length of meta description

Post by roschi »

Hi,

any chance to affect the length of the generated meta description?

Thanks!
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Length of meta description

Post by Thorsten »

Hi,

we use the first 12 words of the question.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
roschi
Posts: 9
Joined: Mon Nov 14, 2016 12:02 pm

Re: Length of meta description

Post by roschi »

I know, but why don't you let the user decide which meta description he likes to use.

At the moment using just 12 words will be around 40-60 characters, while a good meta description has a length of 150/160 characters.
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Length of meta description

Post by Thorsten »

Hi,

well, it can be changed easily: https://github.com/thorsten/phpMyFAQ/bl ... x.php#L289

If you want 20 words, use this code:

Code: Select all

    $metaDescription = str_replace('"', '', $faq->getRecordPreview($id, 20));
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
roschi
Posts: 9
Joined: Mon Nov 14, 2016 12:02 pm

Re: Length of meta description

Post by roschi »

Thanks.

But wouldn't it be better to use characters instead of words?
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Length of meta description

Post by Thorsten »

Hi,

if we would use characters it would be possible to cut words...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
roschi
Posts: 9
Joined: Mon Nov 14, 2016 12:02 pm

Re: Length of meta description

Post by roschi »

Sure, but we're talking about search engine data here ;)

What about combining chars counting with wordwrap? http://php.net/manual/de/function.wordwrap.php
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Length of meta description

Post by Thorsten »

Hi,

wordwrap() adds a linebreak, that doesn't help...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply