我可以删除我的WordPress安装的wp_options表中的瞬态吗? [英] Can I remove transients in the wp_options table of my WordPress install?

查看:295
本文介绍了我可以删除我的WordPress安装的wp_options表中的瞬态吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近注意到,我的 wp_options 表似乎有点大。它包含1161行,大小约为2.1MB。

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.

我安装了清除选项。看起来发展在2010年停止在插件上,但它仍然工作。

I have installed Clean Options. It looks like development stopped on the plugin back in 2010, but it still did the job.

我现在有一个长的可能孤立的条目列表。有没有一个简单的方法去排序这些,并找出哪些要删除和保留?

I now have a long list of potentially orphaned entries. Is there an easy way to go about sorting these, and figuring out which to remove and which to keep? Also, could this be responsible for causing performance issues with the website?

感谢您的阅读,任何想法欢迎!

Thank you for reading, any ideas are welcomed!

更新:清除选项插件在列表中返回一些瞬态,这导致我发现有几百个瞬态文件在 wp_options table。有一整束看起来像:

Update: The Clean Options plugin returned some transients in the list, which lead me to find out that there are several hundred transient files in the wp_options table. There are a whole bunch that look like:


  • _site_transient_browser_5728a0f1503de54634b3716638 ... li>
  • _site_transient_timeout_browser_03df11ec4fda7630a5 ...

  • _transient_feed_83dcaee0f69f63186d51bf9a4 ...

  • _transient_plugin_slugs

  • _transient_timeout_feed_83dcaee0f69f63186d51bf9a4b ...

  • _site_transient_browser_5728a0f1503de54634b3716638...
  • _site_transient_timeout_browser_03df11ec4fda7630a5...
  • _transient_feed_83dcaee0f69f63186d51bf9a4...
  • _transient_plugin_slugs
  • _transient_timeout_feed_83dcaee0f69f63186d51bf9a4b...

等。就像我说的,有几百行,看起来像这样。

and so on. Like I said, there are several hundred rows that take look like this. Is it safe to just dump them?

感谢

推荐答案

可以安全地转储它们。 Wordpress和一些插件将根据需要重新创建瞬变。瞬态或多或少是来自复杂查询的存储值。结果保存为瞬态,以便系统不必反复执行常见查询,而只是查找瞬态(如果存在并且尚未过期)。当然,在做出改变之前备份您的数据库,以免出现错误!

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!

在备份完成后,您可以执行如下的mysql语句:

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

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


$ b b

[ EDIT:语句用转义字符固定,在注释建议后]

[ statement fixed with escape characters, after comment suggestion]

这篇关于我可以删除我的WordPress安装的wp_options表中的瞬态吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆