I solved in this way
$wpdb->query(
$wpdb->prepare(
"DELETE FROM $table_name WHERE Date < now() - INTERVAL 30 DAY")
);
Related Posts:
- How to add a data attribute to a WordPress menu item
- Remove Actions/Filters added via Anonymous Functions
- Programatically add options to “add new” custom field dropdown
- Excluding iPad from wp_is_mobile
- Order posts (across the whole site) by metadata date
- Advantages and disadvantages of using automatic-feed-links
- paginate_links() don’t properly work in search.php?
- How to change the markup WordPress inserts for post images
- When tax_query used, results disappear (0 =1 produced)
- Functions.php code that only runs on localhost?
- hook a functions to change wp-config from functions.php
- Relative URLs and hide /wp-content/themes/
- How can I get $id variable in widget’s form function?
- Check if the user has explicitly set an excerpt
- Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php?
- Use ‘add_theme_support’ instead of ‘add_custom_image_header’ In WordPress 3.4
- Limit the length of the Author Profile Biographical Text
- Slugs as breadcrumbs for Pages
- Generating Responsive Background Image Sizes in PHP
- Change meta tags programatically
- Replacing select2 in admin backend for all selects
- Convert hyphen to underscore in permalinks
- difference between add_object_page and add_menu_page
- Removing Unnecessary Text from Admin Menu without CSS
- Use a function to update post meta based on other post meta
- How to hook into the quick edit action?
- wp_mail not running inside Cron
- Shortcode with custom content attribute?
- Add a Post Thumbnail to an RSS Feed with custom size
- Display WordPress Search
- Override a class function to include a custom template
- How to auto-update child posts whenever the parent post is updated?
- I created a child theme and it doesn’t work for some of the css files
- Make WordPress size and name images for Retina.js
- Remove product description from product archive page
- Logging in redirects to correct page but shows logged out content until forced refresh
- Automatically add author’s name to post_tag
- Print Dashboard menu name and link
- Remove_filter (‘the_content’, ‘wpautop’) is not working
- the_post_thumbnail fallback using hooks
- How to detect first visit of a user?
- Displaying Widgets
- How to programmatically set a menu to be the Primary Menu?
- Pinterest Integration Using functions.php
- Develop function get_template_part in functions.php
- Where does function_exists() look to decide whether a function exists? [closed]
- How can I stop a function from encoding an entity?
- Change comment_reply_link URL
- Ajaxing function in widget class
- Clean-up script tags
- Make “sidebar template” the default template for new pages
- Override woocommerce wc-class function
- Display WooCommerce subscriptions for user [closed]
- Trying to inject twitter metadata into using wp_head action in functions.php – get_the_excerpt() returns null
- Increment price for Woocommerce Minicart [closed]
- Change woocommerce products weight varation based its product category or tags? [closed]
- Function to “Press Update Button” on all posts
- Change WP attachment name to postid during upload only for post type
- Refactor create_function
- Completely disable RSS feeds on WP 5.5.2 and show a 404 page instead of die();
- Check if row exists before inserting
- Missing argument 2 for a custom function widgets_init
- WordPress function for 1 to for many
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- Attach parent category template to all subcategories
- How to hide, and not to remove the attributes metabox?
- how to edit functions.php in a child theme
- Only display link to author social media when it exists [closed]
- Get current page_id before loop, in functions.php
- Menu fallback “menu_class” rendering a “div” instead of a “ul”
- Removing the main link to Jetpack from the menu
- Defining a global array in functions.php?
- Change Rating range in Link Manager
- Get the 5 lastest Featured Posts from a category
- How can you limit srcset on a single type of page?
- Remove Font-Awesome MaxCDN Link & Load Locally
- How To Remove Duplicate Menu Locations
- Create single.php for specific tag by tag id or name
- Set quantity of woocommerce product on page visit [closed]
- function to erase swear words
- get_post_type() in in_array doesn’t work for some reason
- Is it possible to change any of the HTML/URL returned from the_category()
- How to fix Warning: call_user_func_array()?
- Show top commenters without using a plugin
- How to remove set_post_thumbnail_size() in child themes?
- How to get specified parent page title in my function
- Execute function after a post has been published
- Post thumbnail not showing in WP admin area for custom post type
- Activate small php condition at footer over page template
- wp_register_script(… $in_footer = true) not working
- I want to get product attirbute in the section below
- Child theme within a child theme?
- Fatal error: Cannot redeclare when switching themes
- How to load jQuery in the footer – nothing works for me
- Restore Image Title Text
- Using $themename Variables
- How can I grab the video id of youtube?
- How to add a slide toggle to the Woocommerce-Layout__Activity-Panel area in the orders admin page
- Output and filter data from a XML url
- Is possible add icon in title posts only in specific tag?