Is there any possible method to query all orders placed through admin ( backend orders ) using SQL?

The case is to differentiate frontend and backend orders. What exactly I'm trying to achieve is to copy user details from all orders placed from Admin to a new table to integrate with a third-party application.

1 Answer 1


All the orders placed from the backend have the field remote_ip set to null.
So you can filter using an sql query:

SELECT * FROM sales_flat_order where remote_ip IS NULL;

Or via code:

$orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('remote_ip', array('null'=>true));
  • Thanks Marius! The SQL query works just fine! :) Aug 14, 2014 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.