Support » Plugin: LiteSpeed Cache » clearing transients

  • We get a lot of transients each day that require cleaning in order to maintain website performance. Is there a way to have this done automatically, say every 12 hours?
    Thanks

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    unfortunately no from the plugin side

    but there should be a 3rd party plugin can do this , or a code snippet like this

    <?php
    define( 'WP_USE_THEMES', false );
    require( './wp-load.php' );
    
    global $wpdb;
    $table_name = $wpdb->prefix . 'options';
    $table_name = "{$wpdb->prefix}options";
    $wpdb->query( $wpdb->prepare( "DELETE FROM <code>$table_name</code> WHERE <code>option_name</code> like '%\_transient\_%' " ) );
    
    if ( defined( 'LSCWP_V' ) ) {
    do_action( 'litespeed_purge_all' );
    }
    echo "done";

    you can use system cron to access this file to clean transient.

    the code is not tested , but it should work , you can backup your DB first to try.

    • This reply was modified 9 months, 2 weeks ago by qtwrk.
    Thread Starter aseannewstoday

    (@aecnews)

    Hi, Thanks.

    I put this in my functions.php on my sandpit site and it returned an error require(): Failed opening required ‘./wp-load.php’ (include_path=’.:/opt/alt/php74/usr/share/pear’)

    How do I regulate the time for this?

    Is there a similar code snippet I could use to clear Pages.

    I have 10 Pages (not Posts) that get a lot of traffic and I’ve noticed that when we open them sometimes the RSS feeds which are updated every 30 minutes (x 10) don’t load until the database is cleared and Pages flushed in the Toolbox.

    Or recommendations for a plugin to do this?

    Thank you.

    Plugin Support qtwrk

    (@qtwrk)

    No, it’s standalone PHP file , not into the functions.php

    or you can try a plugin , would be an easier solution for you , there is plenty you can find in google

    Thread Starter aseannewstoday

    (@aecnews)

    Thank you. Without a doubt one of the most useless support answers I’ve ever received in 15 years of using WordPress.

    Question: “Or recommendations for a plugin to do this?”

    Answer: or you can try a plugin , would be an easier solution for you , there is plenty you can find in google

    I hope you are extremely proud of yourself in adopting the motto the least you can do for is the least you will do. A total waste of time seeking support from Litespeed cache. I’m glad you didn’t strain yourself. Totally unhelpful.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    on my defense,

    you asked for a feature our plugin doesn’t have , which I have explicitly answered that already , the topic could have ended up in there already.

    then I worked out a code snippet as I wanted to help you as much as I could , even it’s not within my support scope anymore

    then I recommended you to use a plugin directly because you seem didn’t use the code properly , as plugin will be a simpler and easier solution

    and please understand , it is not my support scope to find you a different plugin for a different thing.

    • This reply was modified 9 months ago by qtwrk.
    Thread Starter aseannewstoday

    (@aecnews)

    Hey, dude. You’re the one who suggested a plugin. Obviously you don’t know of one.

    Plugin Support qtwrk

    (@qtwrk)

    yes, I did that.

    this is just like you ask in a traveler forum say like : “I live in Los Angles, what’s best way to get to New York? ”

    and people would say : “buy a ticket, take airplane”

    but you can’t really expect people to tell you which airport , which terminal , which company , which flight , which gate , which seat to take for your journey

    as it’s not within the support scope , I merely provided you an idea for what to proceed next.

    yes, I don’t know one as I don’t use it , but that doesn’t stop me from knowing/thinking it that can be by a 3rd party plugin , even I don’t know which one that is

    and a quick search in WP plugin page would find you this

    https://wporg.ibadboy.net/plugins/artiss-transient-cleaner/

    or this

    https://wporg.ibadboy.net/plugins/transients-manager/

    and please understand, I am not obligated as LiteSpeed Cache support to search this for you , but it is a favour from me.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘clearing transients’ is closed to new replies.