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 » Tue Nov 15, 2016 11:40 am

Hi,

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

Thanks!

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

Re: Length of meta description

Post by Thorsten » Sun Nov 20, 2016 5:11 pm

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 » Mon Nov 21, 2016 3:29 pm

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: 14754
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Length of meta description

Post by Thorsten » Mon Nov 21, 2016 8:37 pm

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 » Tue Nov 22, 2016 10:25 am

Thanks.

But wouldn't it be better to use characters instead of words?

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

Re: Length of meta description

Post by Thorsten » Tue Nov 22, 2016 10:27 am

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 » Tue Nov 22, 2016 10:38 am

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: 14754
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Length of meta description

Post by Thorsten » Thu Nov 24, 2016 8:24 pm

Hi,

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

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Post Reply