• Hello,

    I am importing a feed from another one of my sites successfully. I also have set up Post Expirator successfully to auto-delete after +6 weeks. However, when I import posts, the expirator only activates if I edit the post and click update.

    Is there a way to automatically set this to active?

    I have the option in WP All Import to set customs fields including:
    _expiration-date-options
    _expiration-date-status
    _expiration-date

    Is there a value I can set here that will actually activate the expirator when I import new posts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Yes, same issue
    If you could solve this, it would be great.

    Thanks

    …same…

    same here.

    If no one has found a solution I believe this is the code that works for me with WP All Import. Put in child theme function.php file. It usually deletes 99% of the products. If anyone knows how to get it to delete 100% the would help.

    This is how I put in my WP All Import Template https://ibb.co/8r0GV3T

    And remember you use Unix Time. So for example (1585480966)

    add_action('pmxi_saved_post', 'post_saved', 10, 1);
    
    function post_saved($id) {
       $expiration_date = get_post_meta($id, 'expiration-date', true);
       if ($expiration_date) {
          $opts = array();
          $opts['expireType'] = 'delete';
          $opts['id']         = $id;
          echo "Setting expiration date for post " . $id . " to the timestamp " . $expiration_date;
          _scheduleExpiratorEvent( $id, $expiration_date, $opts );
       } else {
          echo "No expiration date set for post " . $id . ". Exiting";
       }
    }
    • This reply was modified 4 years, 7 months ago by crowds90.
    • This reply was modified 4 years, 7 months ago by crowds90.
    • This reply was modified 4 years, 7 months ago by crowds90.
    • This reply was modified 4 years, 7 months ago by crowds90.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post Expirator and WP All Import’ is closed to new replies.