MyBB Community Forums

Full Version: Google Seo has problem with long titles
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all
My host  has recently changed server, and after that i have problem with opening threads that have long titles.

This is my error when opening threads that have long titles:

Quote:SQL Error:1406 - Data too long for column 'location' at row 1
Query:REPLACE INTO forum_sessions SET
uid='1',sid='f3a3c64c0804a12a98dd278dc8b12bc8',time='1537943864',ip='2.183.54.222',location='/forum/showthread.php?google_seo_thread=آزمون-استخدامی-43نفر-کار-در-وزارت-نیرو-در-سراسر-کشور؛-مهلت-�',useragent='Mozilla/5.0 (Windows NT 6.1; rv:49.0) Gecko/20100101 Firefox/49.0',location1='31',location2='2277',nopermission='0'


Google seo debugging is off, by default. Increasing field size to VARCHAR (15000) also does not work.
Decreasing length of thread titles works, but i cannot do it for all threads one by one.

It sounds for me that Google Seo cannot convert seo-style thread title to original form (i.e. , forum/thread-1272).

Any help would be greatly appreciated.
Sounds to me that data is too long for column 'location' in your forum_sessions table.

Now this is odd since the table is defined as thus:

mybb/install/resources/mysql_db_tables.php Wrote:
$tables[] = "CREATE TABLE mybb_sessions (
  sid varchar(32) NOT NULL default '',
  uid int unsigned NOT NULL default '0',
  ip varbinary(16) NOT NULL default '',
  time int unsigned NOT NULL default '0',
  location varchar(150) NOT NULL default '',
  useragent varchar(200) NOT NULL default '',
...

So location should be varchar(150) which means it allows 150 characters. However the string you posted is only 100 characters (bit unfortunate it contains the subfolder path really). So two possibilities... your database is not defined the way it should be, or it's using the wrong charset (should be utf8 or utf8mb4).

You'll have to check. And then feel free to change that table to allow longer strings.

As for Google SEO, it already has settings to limit URL length (soft limit and hard limit) which you can use to forcibly stop including words into the URL after X characters. So if you prefer your URLs to be shorter, you can already do that too
Thanks frostschutz for your help

As i told, changing column to allow longer strings does not work. Also, i have changed it from utf8 to utf8mb4, but again no help.

when i look into contents of this column, i see something like: "/forum/showthread.php?tid=126&pid=198" or " /forum/showthread.php?tid=151", and i don't see anything like seo-styles titles in records already added to table. In above error, Mybb tries to add a seo-style title with utf8 characters to table and it may be wrong.


Also, the last charaster in string (i.e. "�") sounds strange for me. I myself cannot read it, while other characters in my language are shown correctly.

Thanks again for your attention