Title: Custmizing Order Numbers
Last modified: July 26, 2019

---

# Custmizing Order Numbers

 *  Resolved [SolutionsDEV](https://wordpress.org/support/users/solutionsdev/)
 * (@solutionsdev)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/custmizing-order-numbers/)
 * I need to customize order numbers in the format like (year-month-dayofthemonth-
   orderID), without using any additional plugin.
 * I have got a code and made changes to it with additional text like this:
    add_filter(‘
   woocommerce_order_number’, ‘custom_woocommerce_order_number’, 1, 2 ); function
   custom_woocommerce_order_number( $oldnumber, $order ) { return ‘Hello-‘ . date(“
   Ymd”) . ‘-‘ . $order->id; }
 * This works fine, except that the date is set to current date, what I want is 
   to set it to the date when the order is filled ensuring that once the order number
   is set, it wouldn’t be changed by the code.
 * Would someone help me in this?
 * Thanks,

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Phillip C. a11n](https://wordpress.org/support/users/phillipwoo/)
 * (@phillipwoo)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/custmizing-order-numbers/#post-11817052)
 * Hello,
 * I am not super proficient with PHP but I believe since you are using `date()`
   you will get the current date and it will not match the order date. Since WooCommerce
   orders are custom post types in WordPress, you may have better luck using the`
   get_the_date()` function. You can learn more about that here:
 * [https://developer.wordpress.org/reference/functions/get_the_date/](https://developer.wordpress.org/reference/functions/get_the_date/)
 * It is configured to retrieve the date on which a post was written. I hope that
   helps!
 * Thanks!
 *  [Phillip C. a11n](https://wordpress.org/support/users/phillipwoo/)
 * (@phillipwoo)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/custmizing-order-numbers/#post-11839046)
 * We haven’t heard back from you on this. I am going to mark this as Resolved at
   this time. If you have another issue please feel free to open a new post. 🙂
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custmizing Order Numbers’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Phillip C. a11n](https://wordpress.org/support/users/phillipwoo/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/custmizing-order-numbers/#post-11839046)
 * Status: resolved