EX-23.1 4 exhibit231-consentofeyform.htm EXHIBIT 23.1 - CONSENT OF ERNST & YOUNG LLP Document

EXHIBIT 23.1

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

We consent to the reference to our firm under the caption “Experts” in this Registration Statement (Form S-3) and related Prospectus of The Hershey Company for the registration of debt securities and to the incorporation by reference therein of our reports dated February 17, 2021, with respect to the consolidated financial statements and schedule of The Hershey Company, and the effectiveness of internal control over financial reporting of The Hershey Company, included in its Annual Report (Form 10-K) for the year ended December 31, 2020, filed with the Securities and Exchange Commission.

/s/ ERNST & YOUNG LLP

Philadelphia, Pennsylvania
May 28, 2021