Support » Plugins and Hacks » [Resolved] Parsing Dates

[Resolved] Parsing Dates

  • I’m sending a post by Postie with a subject of 2013-10-31 and this shows up as a new post in WordPress with the subject 2013-10-31, which is fine.

    Now today, I’m sending a post with subject 2013-11-02, and that is showing up as a WordPress post with subject 201302.

    I only have two categories, 2013 and 2014.

    Am I missing something? Can I turn off category parsing in the sujject line? All other months (ie subjects like 2013-03-14, 2013-06-18) work fine.



Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Wayne Allen


    You can try using slashes instead: 2013/03/14

    Postie is looking at all taxonomy entries not just categories.

    I am experiencing this issue as well. Besides using slashes, is there a way to comment the dashes so that they will post verbatim? Looking through the Postie documentation I see that using “{POSTTITLE}” in the body of the message may be helpful, do I have that right?

    My objective would be to post “2014-01-04” for example. At the moment, it is coming through as “201404”. It’s not that bad of an issue. Just wanted to check with you before I switched to another date delimiter because the dashed date format is an ISO standard (https://en.wikipedia.org/wiki/ISO_8601) which is why that format is attractive to me.

    Many thanks.

    As an update, I was experimenting with the categories, and found that if you only have one then the subject line containing -01- works well and posts the date as expected and does not remove it from the post’s title. I am guessing that having a single category may have an effect on the category check which enables the check to be skipped because there is only one category. I would, however, still be interested to know if there is a way to support multiple categories _and_ keep the date in the subject line intact. Perhaps there is a way to use a comment indicator so the category check will be ignored?

    Either way, I’m happy with Postie and am pleased with the value it brings to my posting process. Thank you very much.

    Plugin Author Wayne Allen


    The category logic is not the greatest, but many people use it so I can’t really change it. I have plans to add preferences for the different types of category delimiters which show solve this problem.

    Hi Wayne,
    To follow up on the above conversation thread, when I posted an article with today’s date (2014-03-01) Postie stripped out the “-03-“. I would like to remove this particular feature from the “postie-functions.php” code. I am thinking that if I comment out the below I’ll stand a good chance of being successful (I acknowledge that I’ll have to do this each time Postie is updated which isn’t an issue because Postie is awesome and worth it).

    Would you be able to advise what needs to be commented out? Here is what I think I identified as important to comment out:
    Found on lines 287-690:

    else if (preg_match_all('/-(.[^-]*)-/', $tmpSubject, $matches)) {
                preg_match("/-(.[^-]*)$/", $tmpSubject, $tmpSubject_matches);
                $tmpSubject = trim($tmpSubject_matches[1]);


    Found on lines 2530-2534:

    if (preg_match_all('/-(.[^-]*)-/', $subject, $matches)) { // -<category>- -<category2>- <Subject>
            //preg_match("/-(.[^-]*)$/", $subject, $subject_matches);
            //$subject = trim($subject_matches[1]);
            $matchtypes[] = $matches;


    Many thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Parsing Dates’ is closed to new replies.