Limit description length to 160 in 1.6.4
Limit description length to 160 in 1.6.4
Hi developers,
I am just reading that Auntie Google says that the description should have no more than 160 chars. Would be nice if we could limit the field to 160, so that users stay conform to Googles wishes.
I'd rename the field in the language backend to "description (max 160 chars)"
I am just reading that Auntie Google says that the description should have no more than 160 chars. Would be nice if we could limit the field to 160, so that users stay conform to Googles wishes.
I'd rename the field in the language backend to "description (max 160 chars)"
Re: Limit description length to 160 in 1.6.4
I'm not sure. Other search engines have slightly different limits, AFAIK, and these limits might change over time, anyhow. And we have to consider what to do with existing descriptions that are longer than the limit.svasti wrote:Would be nice if we could limit the field to 160, so that users stay conform to Googles wishes.
Anyway, Google seems to present shorter descriptions sometimes, see e.g. "realblog_xh":
which are 133 characters, while cutting before the next comma ("gemacht werden") would have resulted in 148 characters.Realblog_XH ermöglicht die Präsentation eines Blogs auf Ihrer CMSimple_XH Website. Jeder Blog-Beitrag kann individuell kommentierbar ...
Instead of imposing a strict limit, we may consider to better document the issue; AFAIK there is also no documentation regarding the (mostly?) pointless keywords. I've seen several sites where the keywords were set (not rarely a looong list), but the description defaulted to "Enter website description for search engine results here".
Anyway, I've put it on the roadmap.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Limit description length to 160 in 1.6.4
We could instead of limiting the chars count have a counter. Otherwise it's difficult to know if one has exceeded Googles limit. You want google to use the description and not to abbreviate it with "...". How to know you exceeded the limit?
Good point, so it would be better not to limit the chars but to have a counter, so that the user will see right away if he is over the top or not. That would have to be some javascript.cmb wrote:And we have to consider what to do with existing descriptions that are longer than the limit.
Re: Limit description length to 160 in 1.6.4
Good idea! Currently I'm writing the descriptions in a text editor to see the length, so this would be an improvement.svasti wrote:Good point, so it would be better not to limit the chars but to have a counter, so that the user will see right away if he is over the top or not. That would have to be some javascript.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Limit description length to 160 in 1.6.4
Indeed, but it shouldn't be hard. Basically, there has to be an event listener which recognizes all changes to the textarea. We already have that as part of XH.makeAutosize(), so it would make sense to factor out something like XH.addInputEventListener(textarea, listener). The listener would simply have to find out the character count:svasti wrote:That would have to be some javascript.
Code: Select all
document.getElementById("meta_tags").elements.description.value.length
Christoph M. Becker – Plugins for CMSimple_XH
Re: Limit description length to 160 in 1.6.4
Right now I can't find it, but some years ago we discussed it with Gert in his RealBlog. There was tested a counter just below the textarea set as a countdown showing chars left to the pre-set limit.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Limit description length to 160 in 1.6.4
Ah, interesting! I assume that was when Realblog had a textarea for the teaser, and a WYSIWYG editor only for the full article (Realblog_XH <= 1.3, or so).Tata wrote:Right now I can't find it, but some years ago we discussed it with Gert in his RealBlog. There was tested a counter just below the textarea set as a countdown showing chars left to the pre-set limit.
Anyway, I'd rather not count down from some given limit, but count up from 0 and let the user decide how much text to write.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Limit description length to 160 in 1.6.4
Well, but mostly there are limits for texts in various engines. In this case it would be fine if one can see how many characters are left. There is no advantage to say how many character I want write if there is some limit that I am not aware of. In the countdown counter I see on the beginning how many I can use.cmb wrote:Anyway, I'd rather not count down from some given limit, but count up from 0 and let the user decide how much text to write.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Limit description length to 160 in 1.6.4
Yes, but these limits seem to vary between search engines, and are not necessarily known[1]. Telling the user "you have N characters left", even though we can only roughly estimate the limit, seems wrong to me. IMO it's better to leave the final decision to each user.Tata wrote:Well, but mostly there are limits for texts in various engines.
[1] For instance, I've read several times that the number of characters of the meta description should not exceed 160 or 156 for Google. However, we're using Unicode, so it's not clear, whether that is measured in code points or graphemes. And now I found an article on sistrix.de, and they are saying that Google actually measures pixel based (consider the difference between "i" and "m").
Christoph M. Becker – Plugins for CMSimple_XH
Re: Limit description length to 160 in 1.6.4
I have implemented the basic character (actually, code point) counting mechanism (r1449). The presentation can obviously be improved -- any suggestions? Those who do not have an SVN client available can get a snapshot of a certain revision from SourceForge: http://sourceforge.net/p/cmsimplexh/code/1449/tarball (replace 1449 with the revision you're looking for).
Christoph M. Becker – Plugins for CMSimple_XH