Exhibit 23.1

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

We consent to the incorporation by reference in the Registration Statements (Form S-3 Nos. 333-157793 and 333-180360 and Form S-4 No. 333-185579) of W&T Offshore, Inc. and in the related Prospectuses, and the Registration Statements (Form S-8 Nos. 333-159005 and 333-126252) pertaining to the W&T Offshore, Inc. Long-Term Incentive Compensation Plan, and Registration Statement (Form S-8 No. 333-126252) pertaining to the W&T Offshore, Inc. 2004 Directors Compensation Plan of our reports dated February 27, 2013, with respect to the consolidated financial statements of W&T Offshore, Inc. and subsidiaries, and the effectiveness of internal control over financial reporting of W&T Offshore, Inc. and subsidiaries included in this Annual Report (Form 10-K) for the year ended December 31, 2012.

/s/ ERNST & YOUNG LLP

Houston, Texas

February 27, 2013