• Resolved funkygorilla

    (@funkygorilla)


    Hi, I have a strange issue where I am serving content to different sites via the REST API. Some sites require a products table, which I add using tablepress. At the same time I have some sites using WPBakery PageBuilder and others using Visual Composer and the central repository adds in WPBakery shortcodes for the moment. New sites I need to strip this code out as efficiently as possible so I essentially do a bunch on find and replaces.

    You are probably wondering what any of this has to do with tablepress! Essentially my find and replaces were inconsistent until I noticed the problem. The tablepress cache adds in an html comment to say that it is cached. So for example on https://www.brenclosuresfeed.com/wp-json/wp/v2/pages/2393/ at the moment in ACF, tab_1_content you will see a comment at the end of the text “<!– #tablepress-102-no-3 from cache –>” where as on page https://www.brenclosuresfeed.com/wp-json/wp/v2/pages/2400/ currently you don’t.

    Rather than have to add in another find and replace, is there any way to switch off that comment? I saw you can switch off the cache, which is a possibility, but in general the cache is a good thing.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Yes, that should not be a problem. Please try adding this to your theme’s “functions.php” (or some other more reasonable place in your custom code):

    add_filter( 'tablepress_cache_hit_comment', '__return_empty_string' );
    

    Regards,
    Tobias

    Thread Starter funkygorilla

    (@funkygorilla)

    Hi Tobias

    Thanks, that worked a treat.

    Cheers

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Tablepress Cache Comment’ is closed to new replies.