Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressでトランシエントを管理・削除する方法(簡単な方法)

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

WordPressでTransientを管理・削除する方法を知りたいですか?

トランシエントはWordPressのプラグインやテーマのデータを一時的に保存するためにWordPressで使用されます。トランシエントを管理することで、速度を最適化し、サイトが常に正常に動作するようにすることができます。

この投稿では、WordPressでTransientを簡単に管理・削除する方法をご紹介します。

How to manage and delete transients in WordPress (the easy way)

WordPressのトランジェントとは?

WordPressのプラグインやテーマの開発者は、WordPressのデータベースに時間の影響を受けやすい情報を保存するために、しばしばtransientを使用します。

これにより、プラグインやテーマがより高速に機能するようになり、サーバー全体の負荷を軽減しながらWordPressサイトのパフォーマンスを向上させることができます。

例えば、多くのWordPressソーシャルメディアプラグインは、ブログ投稿のシェア数データを保存するためにtransientを使用します。

もしトランシエントを使わなければ、サーバーはページをロードするたびにすべてのソーシャルネットワークに接続する必要があり、ロード時間が大幅に長くなる。

Data stored in transients example

なぜトランジェントを削除して管理したいのですか?

トランジェントは非常に便利だが、時にはうまくいかないこともある。

例えば、FacebookとWordPressサイトの接続がうまくいっていない場合、投稿のシェア数が0と表示されます。

Transientが切れるのを待つ代わりに、キャッシュされたデータをクリアするだけで、瞬時に正しいシェア数を得ることができる。

人気投稿やシェア数が表示されないという問題が発生し、WordPressのキャッシュをクリアした場合、それはトランジェントの問題である可能性があります。

期限切れのTransientを消去することは、WordPressデータベースを最適化し、パフォーマンスを向上させるのにも役立ちます。これは、ステージングサイトをライブWordPress ホスティングサービスサーバーに移行する際に役立ちます。

WordPressはCookieのようなものですか?

WordPressのトランシエントは、開発者が一時的な情報を保存できるという点で、Cookieと似ています。しかし、トランシエントはより強力で、より多くのことができます。

例えば、Cookieは訪問者のブラウザーに保存されますが、いくつかの制限があります。クッキーは、訪問者のブラウザに保存され、いくつかの制限があります。

一方、TransientはWordPressのデータベースに保存され、複数のタイプのデータを保存でき、簡単にプログラム可能で、より安全である。

それでは、WordPressでTransientを管理・削除する方法を見ていきましょう。ここでは2つの方法を取り上げますが、ほとんどのユーザーには方法1をお勧めします:

方法 1: Transients Manager (無料) でトランジェントを管理する。

WordPressでトランジェントを管理・削除する最良の方法は、Transients Managerプラグインを使用することです。WordPress のトランシエントを簡単に管理、削除、編集できます。

最初に行う必要があるのは、プラグインを有効化してインストールすることです。詳しくは、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

有効化した後、WordPressダッシュボードのツール ” トランシエントに移動する必要があります。WordPress データベースに保存されているトランシエントのリストが表示されます。

Transients manager plugin screen

一括削除タスクを実行することも、トランシエントを個別に削除することもできます。

このページでは、以下の一括操作を行うことができます:

  • 期限切れの Transient を削除する。
  • 選択したTransientを削除する。
  • 有効期限のあるトランシエントをすべて削除する。
  • Transient をすべて削除する。

Transientを識別するには、単に名前を見ます。たとえば、’wpforms_t15s_wpforms’ という名前の transient はWPFormsプラグインに関連付けられています。

名前列の右隣には、それぞれのトランジェントの値が表示される。Transientの値には、オブジェクト、配列、数値、英数字文字列を指定することができます。

各Transientの有効期限も表示されます。中には有効期限が設定されていないものもあり、その場合は「有効期限なし」と表示されます。

Delete’ボタンをクリックするだけで、これらのトランジエントを削除することができます。

個々のトランジェントを編集するには、「アクション」列の「編集」リンクをクリックするだけです。すると、値や有効期限を設定したり、トランジエントの名前を変更したりできる画面が表示されます。

Edit single transient

この機能は、テーマやプラグインをテストしていて、異なるtransient値でチェックしたい場合に便利です。

Transientに変更を加えた場合は、必ず「Save Changes」ボタンをクリックしてください。

方法2:WP Rocketでトランジェントを管理する

WP Rocketキャッシュプラグインを使用している場合、ビルトイン設定があり、トランジエントを管理・削除することができます。

設定 ” WP Rocketに移動し、’データベース’メニューオプションをクリックするだけです。

WP Rocket dashboard

次に、’Transient Cleanup’セクションまでスクロールダウンする。

ここで、すべてまたは期限切れのトランジエントだけを自動的に削除したい場合は、ボックスにチェックを入れます。

Check boxes transient cleanup

変更が終わったら、ページの一番下にある「変更を保存して最適化する」をクリックしてください。

詳しくは、WordPressサイトを高速化するWP Rocketの適切な設定方法をご覧ください。

この投稿が、WordPressでTransientを簡単に管理・削除する方法のお役に立てば幸いです。また、無料メールドメインの取得方法や、WordPressプラグインのエキスパートが選ぶビジネス必携プラグインもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

17件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

    • WPBeginner Support says

      You should normally only need to delete them if you run into a problem with them :)

      管理者

      • Jiří Vaněk says

        Thank you for the clarification. I use the sweep plugin for deleting revisions, so I was wondering if I should also delete the trsnsient that it sees there, or only in case of problems. I delete revisions regularly.

  2. Rob says

    @wpbeginner, Plugin page at WordPress shows last update of Transients Manager plugin was 2022. As the plugin is maintained by WPBeginner, any updating to be done soon?

  3. Margarida Fernandes says

    Is it completely safe to delete all Transients? Even the ones that have nor expired?
    Can anything get broken in the site or stop working properly?
    I use WooCommerce and WPML. Both of these save transients. Is this safe to delete from their tables in the database also?

    • WPBeginner Support says

      If a plugin needs a transient that you deleted as long as it is a well coded plugin, it will recreate the transient. If you’re editing the database correctly, we would recommend checking with the plugin’s support first to ensure you’re removing the correct data.

      管理者

      • Margarida Fernandes says

        All Plugins I use are reliable like WPML, Woocomerce and Yoast.
        I see a lot of transients from woocomerce and WPML and I just want to be sure it is safe to delete them. But I will do as you suggest.
        Thank you so much for the attention.

  4. Finn says

    As mentioned in one of the above posts, Pippin’s plugin does now have a button for bulk delete.
    I suggest that you update the post – I almost missed that post and installed two plugins, where only one was needed.
    Otherwise, great and straightforward post as always.

  5. Daniel says

    Hi, great post! I am using Transients in the same way–for social media share counts. Using the Answer posted here:

    Everything is working, however it is not giving me accurate share counts for all of the posts. Some have the correct share count others just show what appears to be a random number. For example a post that has 65 facebook likes only shows 1 when the transient code is added. When I remove the Transient it shows the accurate number of shares for all of them. Any ideas of what could cause this?

    Anything that could point me in the right direction would be appreciated.
    Thanks

  6. Matthias says

    Hey there,

    how would one bulk delete transients which are not needed but also do not have any expiration date?

  7. Nicolai says

    Great post! This helped me clear about 300 megabytes from my wp_options table! I still have thousands of entries in there, many with no expiration date. I have a feeling that most are not needed. How do I go about finding out? For example, I have hundreds like these: “wc_max_related_3461814294618….” They have no expiration so will conceivably be there forever! What is the worst that could happen if I delete ALL transients?

  8. gWorldz says

    Pippin Williamson’s Transients Manager now has a bulk deletion option for expired transients negating the need for Delete Expired Transients. It does not offer the ability to delete all transients but this is probably for the best for beginners and inexperienced users o.O

  9. RW says

    @wpbeginner, great post! This is one area where wordpress, for some reason, doesn’t clean up after it’s self. I just use this simple SQL in phpmyadmin DELETE FROM `wp_options` WHERE `option_name` LIKE ('%_transient_%') and replace wp_options with whatever my options table has been renamed to. Takes 30 seconds….

    I like the idea of being able to do this through admin of the site, but sometimes I feel I have too many plugins already.

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。