Skip to content
Advertisement

Update field with a shorter string

I need to modify the LENGTH of text in field in db mysql.

I’ve attribute_name that I need to have with max LENGTH 28 characters. WordPress and woocommerce limit this field to 28 characters.

Right now my website is down because some taxonomies are too long. There is a way to “cut” all attribute_name <= 28? All my attribute_name should be max LENGTH 28.

I’ve used:

To show only items longer than 28 characters. Result: 669 rows.

Then I’ve tried with:

It show me the correct string, but it doesn’t update my original field.

Someone can help me? Thanks

Advertisement

Answer

Starting from your existing select query, you can just do:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement