Can I remove transients in the wp_options table of my WordPress install?

前端 未结 3 809
时光取名叫无心
时光取名叫无心 2020-12-22 19:31

I have recently noticed that my wp_options table seems to be a bit large. It contains 1161 rows, and is about 2.1mb in size.

I have installed Clean Opti

3条回答
  •  孤城傲影
    2020-12-22 19:54

    You can safetly dump them. Wordpress and some plugins will re-create transients as needed. A transient is more or less the stored value from a complex query. The results are saved as a transient so that the system doesn't have to perform a common query over and over, instead it just looks for the transient if it exists and hasn't expired. Of course, make a backup of your database before making a change lest something goes wrong!

    After backing everything up, you can run a mysql statement like this:

    DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\_transient\_%')
    

    [EDIT: statement fixed with escape characters, after comment suggestion]

提交回复
热议问题