Home Forums Tech Database Find dates available for your WordPress post

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #9319
    Udar Gromov

    Let’s say that almost all days are already taken by your WordPress posts for several weeks ahead.
    And you do not want to overwhelm your audience with more than one article per day.
    How to find an available date where you can place your new WP article?
    You can use phpMyAdmin and this SQL statement below:

    SELECT date(DATE_ADD(A.post_date, INTERVAL 1 DAY)) "Available date"
    , A.ID, A.post_type, A.post_title, date(A.post_date) FROM wp_posts A
    WHERE A.post_type = 'post' AND date(A.post_date) 
    BETWEEN '2023-12-01' AND '2025-04-18'
    AND date(A.post_date) NOT IN (SELECT date(DATE_ADD(B.post_date, INTERVAL -1 DAY)) 
    FROM wp_posts B WHERE B.post_type = 'post')

    This SQL statement displays an available dates for your new post (that doesn’t exist yet) if it finds a post that has no post scheduled for the next day. Just adjust FRON and TO dates as needed.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.