Prevent changing the length of post_name column on WordPress Update

Question

We’ve some Arabic websites running on WordPress, and use Arabic slugs in the posts’ URLs.

You know that post slug is stored in the post_name column in wp_posts table, and the default length of this column is 200 characters, which is not enough for Arabic slugs that are being encoded before being stored in this column. For that, we changed the length of this column to 1000 characters to hold the long encoded slugs that we have.

The issue, when we update the WordPress code to a major update, it trims this column back to 200 characters, and this breaks the posts’ URLs. This happens if you login for the first time after the update to the CMS or do a Network Upgrade that is prompted after each major update.

Is there any way to prevent WordPress from touching the tables’ structure?

0
, , , Jafar Abazeed 3 years 2020-08-12T06:10:58-05:00 0 Answers 49 views 0

Leave an answer

Browse
Browse