<?xml version="1.0" encoding="UTF-8"?>

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2022 Workiva-->
<!--r:a14572b4-02f0-4f05-af63-8c2f4263fa42,g:a8663541-66c9-4b7c-ac42-85d3e0d1f6fa-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/all" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#all"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#hypercube-dimension"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-default"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-domain"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/domain-member" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#domain-member"/>
  <link:roleRef roleURI="http://www.hersheys.com/role/DOCUMENTANDENTITYINFORMATION" xlink:type="simple" xlink:href="hsy-20221002.xsd#DOCUMENTANDENTITYINFORMATION"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DOCUMENTANDENTITYINFORMATION" xlink:type="extended" id="i439767d905154d86a2dcdcd3e355b9ac_DOCUMENTANDENTITYINFORMATION">
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentType_d10f2942-f72b-413c-bed8-e0cfbd4d744b" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_DocumentType"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_DocumentType_d10f2942-f72b-413c-bed8-e0cfbd4d744b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentQuarterlyReport_28666e53-2cc6-4776-9bb5-b657315d8d6d" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_DocumentQuarterlyReport"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_DocumentQuarterlyReport_28666e53-2cc6-4776-9bb5-b657315d8d6d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentPeriodEndDate_f6d12c6a-effb-4787-a489-28dab0113823" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_DocumentPeriodEndDate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_DocumentPeriodEndDate_f6d12c6a-effb-4787-a489-28dab0113823" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentTransitionReport_e825c557-84eb-460e-bd5e-3ac8b3e5dd24" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_DocumentTransitionReport"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_DocumentTransitionReport_e825c557-84eb-460e-bd5e-3ac8b3e5dd24" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityFileNumber_e2f0199b-b78c-4210-a8bf-0093b4d8c7a5" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityFileNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityFileNumber_e2f0199b-b78c-4210-a8bf-0093b4d8c7a5" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityRegistrantName_fd8e4a4b-c955-4c28-9d28-6033b268ff2c" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityRegistrantName"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityRegistrantName_fd8e4a4b-c955-4c28-9d28-6033b268ff2c" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityIncorporationStateCountryCode_f0436eb5-54c6-4523-9476-2f688b829c7f" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityIncorporationStateCountryCode"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityIncorporationStateCountryCode_f0436eb5-54c6-4523-9476-2f688b829c7f" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityTaxIdentificationNumber_5efd023f-a731-4cb1-b45c-1fa7d69583c4" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityTaxIdentificationNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityTaxIdentificationNumber_5efd023f-a731-4cb1-b45c-1fa7d69583c4" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressAddressLine1_61430099-9a24-43a9-a975-c19ae81f783c" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityAddressAddressLine1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityAddressAddressLine1_61430099-9a24-43a9-a975-c19ae81f783c" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressCityOrTown_ca7a9f11-27ac-4269-a249-5082a12e108c" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityAddressCityOrTown"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityAddressCityOrTown_ca7a9f11-27ac-4269-a249-5082a12e108c" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressStateOrProvince_d83fbac3-3278-4575-9a3b-56ad06912df0" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityAddressStateOrProvince"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityAddressStateOrProvince_d83fbac3-3278-4575-9a3b-56ad06912df0" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressPostalZipCode_1b7892bd-22fe-4ed9-88be-27b002f943ae" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityAddressPostalZipCode"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityAddressPostalZipCode_1b7892bd-22fe-4ed9-88be-27b002f943ae" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_CityAreaCode_a19a4b55-dee3-41e9-a356-816e1a793467" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_CityAreaCode"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_CityAreaCode_a19a4b55-dee3-41e9-a356-816e1a793467" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_LocalPhoneNumber_ca35afea-abdd-4bb7-aa3a-0708e50fc19a" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_LocalPhoneNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_LocalPhoneNumber_ca35afea-abdd-4bb7-aa3a-0708e50fc19a" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_Security12bTitle_43765e4d-8f8b-4a82-920f-6ceb4092b7d6" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_Security12bTitle"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_Security12bTitle_43765e4d-8f8b-4a82-920f-6ceb4092b7d6" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_TradingSymbol_65366193-4455-4e99-8062-a5fa40aab2a1" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_TradingSymbol"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_TradingSymbol_65366193-4455-4e99-8062-a5fa40aab2a1" xlink:type="arc" order="15"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_SecurityExchangeName_5584f22d-2b06-4ef8-9bee-2debf0f282ab" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_SecurityExchangeName"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_SecurityExchangeName_5584f22d-2b06-4ef8-9bee-2debf0f282ab" xlink:type="arc" order="16"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCurrentReportingStatus_376a5f3e-ed46-46e4-bfb9-8e51afbb7f63" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityCurrentReportingStatus"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityCurrentReportingStatus_376a5f3e-ed46-46e4-bfb9-8e51afbb7f63" xlink:type="arc" order="17"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityInteractiveDataCurrent_255c795c-8c36-4bde-817c-ebbd37ce2913" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityInteractiveDataCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityInteractiveDataCurrent_255c795c-8c36-4bde-817c-ebbd37ce2913" xlink:type="arc" order="18"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityFilerCategory_256aedc8-c72d-4c72-a3e8-fbe2bc86ade4" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityFilerCategory"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityFilerCategory_256aedc8-c72d-4c72-a3e8-fbe2bc86ade4" xlink:type="arc" order="19"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntitySmallBusiness_4a8c20e1-ad1c-41da-b153-2d4af823cd44" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntitySmallBusiness"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntitySmallBusiness_4a8c20e1-ad1c-41da-b153-2d4af823cd44" xlink:type="arc" order="20"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityEmergingGrowthCompany_2cebd40b-f0c0-45b9-a118-44da3fbda788" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityEmergingGrowthCompany"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityEmergingGrowthCompany_2cebd40b-f0c0-45b9-a118-44da3fbda788" xlink:type="arc" order="21"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityShellCompany_a3c83d60-b115-43a8-8fe0-c7c266ecfd7d" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityShellCompany"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityShellCompany_a3c83d60-b115-43a8-8fe0-c7c266ecfd7d" xlink:type="arc" order="22"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCommonStockSharesOutstanding_9d30ecbf-85e9-4d41-a4ef-7f0267ebde0e" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityCommonStockSharesOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityCommonStockSharesOutstanding_9d30ecbf-85e9-4d41-a4ef-7f0267ebde0e" xlink:type="arc" order="23"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCentralIndexKey_b9503560-f144-4829-aca2-f0223a7724d1" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntityCentralIndexKey"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntityCentralIndexKey_b9503560-f144-4829-aca2-f0223a7724d1" xlink:type="arc" order="24"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentFiscalYearFocus_4216c259-8399-41d8-9a5e-48a15498bc0f" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_DocumentFiscalYearFocus"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_DocumentFiscalYearFocus_4216c259-8399-41d8-9a5e-48a15498bc0f" xlink:type="arc" order="25"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_CurrentFiscalYearEndDate_d4470412-4bd7-4769-8ed3-22a0378f9467" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_CurrentFiscalYearEndDate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_CurrentFiscalYearEndDate_d4470412-4bd7-4769-8ed3-22a0378f9467" xlink:type="arc" order="26"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentFiscalPeriodFocus_1cce8535-a780-4a4d-922b-7a3a0055f1d2" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_DocumentFiscalPeriodFocus"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_DocumentFiscalPeriodFocus_1cce8535-a780-4a4d-922b-7a3a0055f1d2" xlink:type="arc" order="27"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_AmendmentFlag_e2005b3d-37ac-4884-9cc2-e89f5f89c667" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_AmendmentFlag"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_AmendmentFlag_e2005b3d-37ac-4884-9cc2-e89f5f89c667" xlink:type="arc" order="28"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntitiesTable_5c748827-f470-4b82-927d-3be87613add7" xlink:href="https://xbrl.sec.gov/dei/2022/dei-2022.xsd#dei_EntitiesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_dei_EntityInformationLineItems_f9910ecc-288b-4f0c-83ba-b7f3f47c019a" xlink:to="loc_dei_EntitiesTable_5c748827-f470-4b82-927d-3be87613add7" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_79e777d7-cd38-4535-af97-cdf907dc93a9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_dei_EntitiesTable_5c748827-f470-4b82-927d-3be87613add7" xlink:to="loc_us-gaap_StatementClassOfStockAxis_79e777d7-cd38-4535-af97-cdf907dc93a9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_79e777d7-cd38-4535-af97-cdf907dc93a9_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_79e777d7-cd38-4535-af97-cdf907dc93a9" xlink:to="loc_us-gaap_ClassOfStockDomain_79e777d7-cd38-4535-af97-cdf907dc93a9_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_bf367b4e-4800-453a-a267-653c05509700" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_79e777d7-cd38-4535-af97-cdf907dc93a9" xlink:to="loc_us-gaap_ClassOfStockDomain_bf367b4e-4800-453a-a267-653c05509700" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_1e6b9878-9cf3-4111-94af-00daab3c4142" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_bf367b4e-4800-453a-a267-653c05509700" xlink:to="loc_us-gaap_CommonStockMember_1e6b9878-9cf3-4111-94af-00daab3c4142" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_3908b5db-e1c0-4805-a627-d37e55413dd5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_bf367b4e-4800-453a-a267-653c05509700" xlink:to="loc_us-gaap_CommonClassBMember_3908b5db-e1c0-4805-a627-d37e55413dd5" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFINCOME" xlink:type="simple" xlink:href="hsy-20221002.xsd#CONSOLIDATEDSTATEMENTSOFINCOME"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFINCOME" xlink:type="extended" id="id9e7382bc30c4af0973bc84994300824_CONSOLIDATEDSTATEMENTSOFINCOME">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_8e14c2ec-b9d7-4dcd-ae56-21fd5640008f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_8e14c2ec-b9d7-4dcd-ae56-21fd5640008f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfGoodsAndServicesSold_9d3b299c-9fff-4fb6-9243-7cee199090a6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CostOfGoodsAndServicesSold"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_CostOfGoodsAndServicesSold_9d3b299c-9fff-4fb6-9243-7cee199090a6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GrossProfit_ab7a52e1-2056-44b6-acf9-5faa8a13d5b0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GrossProfit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_GrossProfit_ab7a52e1-2056-44b6-acf9-5faa8a13d5b0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpense_c6aaceb2-cef8-424a-8f25-8f5491b61564" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SellingGeneralAndAdministrativeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_SellingGeneralAndAdministrativeExpense_c6aaceb2-cef8-424a-8f25-8f5491b61564" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_RestructuringChargesBusinessRealignment_56189f1c-f6fc-4dad-a2df-b7df216aece5" xlink:href="hsy-20221002.xsd#hsy_RestructuringChargesBusinessRealignment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_hsy_RestructuringChargesBusinessRealignment_56189f1c-f6fc-4dad-a2df-b7df216aece5" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_5a85fd1b-a800-4325-a7ee-4a293389784f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_OperatingIncomeLoss_5a85fd1b-a800-4325-a7ee-4a293389784f" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_bb736351-b4c3-4557-8168-cedbd47bc76c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_InterestIncomeExpenseNonoperatingNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_bb736351-b4c3-4557-8168-cedbd47bc76c" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_5d48250b-457f-406c-9ffe-1b7513393c94" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_5d48250b-457f-406c-9ffe-1b7513393c94" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_3fba9c27-ad1d-4543-91ad-c794806665d0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_3fba9c27-ad1d-4543-91ad-c794806665d0" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_f2dca344-fdd3-451a-b64c-61b30dbb091d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_f2dca344-fdd3-451a-b64c-61b30dbb091d" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProfitLoss_b02ce6e3-d269-4d96-8d2c-897058298ef2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ProfitLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_ProfitLoss_b02ce6e3-d269-4d96-8d2c-897058298ef2" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLossAttributableToNoncontrollingInterest_d37573aa-3b41-4985-9ed3-b4101f57f9f9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetIncomeLossAttributableToNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_NetIncomeLossAttributableToNoncontrollingInterest_d37573aa-3b41-4985-9ed3-b4101f57f9f9" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_75f5d530-8a75-47f3-8997-ebf51f52a0ab" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_NetIncomeLoss_75f5d530-8a75-47f3-8997-ebf51f52a0ab" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicAbstract_4806683c-4317-4b78-846a-4af3c230c656" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EarningsPerShareBasicAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_EarningsPerShareBasicAbstract_4806683c-4317-4b78-846a-4af3c230c656" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasic_6ad7879e-686a-4244-91a1-9fdf0797438b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EarningsPerShareBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicAbstract_4806683c-4317-4b78-846a-4af3c230c656" xlink:to="loc_us-gaap_EarningsPerShareBasic_6ad7879e-686a-4244-91a1-9fdf0797438b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDilutedAbstract_0aa5cc83-026a-42ad-90e2-7be35f83c64f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EarningsPerShareDilutedAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_EarningsPerShareDilutedAbstract_0aa5cc83-026a-42ad-90e2-7be35f83c64f" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDiluted_6fd876f9-dd97-42de-8a66-eddfc35186eb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EarningsPerShareDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedAbstract_0aa5cc83-026a-42ad-90e2-7be35f83c64f" xlink:to="loc_us-gaap_EarningsPerShareDiluted_6fd876f9-dd97-42de-8a66-eddfc35186eb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStockAbstract_2e689de8-b484-4bc7-9de8-7804abe79d81" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DividendsCommonStockAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_DividendsCommonStockAbstract_2e689de8-b484-4bc7-9de8-7804abe79d81" xlink:type="arc" order="15"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockDividendsPerShareCashPaid_0ad5f862-90b4-401e-90a3-278cd04b54b7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockDividendsPerShareCashPaid"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DividendsCommonStockAbstract_2e689de8-b484-4bc7-9de8-7804abe79d81" xlink:to="loc_us-gaap_CommonStockDividendsPerShareCashPaid_0ad5f862-90b4-401e-90a3-278cd04b54b7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_cd204dc1-540d-4e51-b0ad-1d48b7a31b30" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_295dc6be-8523-4763-bcd5-61d40ba9e253" xlink:to="loc_us-gaap_StatementTable_cd204dc1-540d-4e51-b0ad-1d48b7a31b30" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_5258f71c-ca6e-4665-8374-97d8e1c2bdad" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_cd204dc1-540d-4e51-b0ad-1d48b7a31b30" xlink:to="loc_us-gaap_StatementClassOfStockAxis_5258f71c-ca6e-4665-8374-97d8e1c2bdad" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_5258f71c-ca6e-4665-8374-97d8e1c2bdad_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_5258f71c-ca6e-4665-8374-97d8e1c2bdad" xlink:to="loc_us-gaap_ClassOfStockDomain_5258f71c-ca6e-4665-8374-97d8e1c2bdad_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_e1822428-6294-4188-bc81-e7c08b35ec89" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_5258f71c-ca6e-4665-8374-97d8e1c2bdad" xlink:to="loc_us-gaap_ClassOfStockDomain_e1822428-6294-4188-bc81-e7c08b35ec89" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_7b22f2ca-9c94-40d0-aeee-6a0c19ff1e6b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_e1822428-6294-4188-bc81-e7c08b35ec89" xlink:to="loc_us-gaap_CommonStockMember_7b22f2ca-9c94-40d0-aeee-6a0c19ff1e6b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_515dc318-bb1c-47de-93d1-5b08b67fdf2c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_e1822428-6294-4188-bc81-e7c08b35ec89" xlink:to="loc_us-gaap_CommonClassBMember_515dc318-bb1c-47de-93d1-5b08b67fdf2c" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETS" xlink:type="simple" xlink:href="hsy-20221002.xsd#CONSOLIDATEDBALANCESHEETS"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETS" xlink:type="extended" id="i5df9cef5e8414dd4937cbfe263746ad5_CONSOLIDATEDBALANCESHEETS">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_2eb6934b-3208-4e85-9e72-28e641fa5bc2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsAbstract_aa4957b0-4fd5-49ee-a25b-d086d5fb8950" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetsAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_2eb6934b-3208-4e85-9e72-28e641fa5bc2" xlink:to="loc_us-gaap_AssetsAbstract_aa4957b0-4fd5-49ee-a25b-d086d5fb8950" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrentAbstract_59614a4f-2afe-4a8a-8bad-23b659bafc10" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetsCurrentAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_aa4957b0-4fd5-49ee-a25b-d086d5fb8950" xlink:to="loc_us-gaap_AssetsCurrentAbstract_59614a4f-2afe-4a8a-8bad-23b659bafc10" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_881ae02c-5ecf-46fe-8ea6-ec28319f9a25" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_59614a4f-2afe-4a8a-8bad-23b659bafc10" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_881ae02c-5ecf-46fe-8ea6-ec28319f9a25" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsReceivableNetCurrent_32d285f1-a25c-4676-9cc2-e52f5b2616d1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccountsReceivableNetCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_59614a4f-2afe-4a8a-8bad-23b659bafc10" xlink:to="loc_us-gaap_AccountsReceivableNetCurrent_32d285f1-a25c-4676-9cc2-e52f5b2616d1" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet_a29c045f-0f57-46de-be68-d6e6d2f4d080" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_InventoryNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_59614a4f-2afe-4a8a-8bad-23b659bafc10" xlink:to="loc_us-gaap_InventoryNet_a29c045f-0f57-46de-be68-d6e6d2f4d080" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_675cb202-c0e5-47e9-b202-83eda840a0a8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_59614a4f-2afe-4a8a-8bad-23b659bafc10" xlink:to="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_675cb202-c0e5-47e9-b202-83eda840a0a8" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_7e931151-ee85-4f35-a1de-2e9d8ea2c7d2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetsCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_59614a4f-2afe-4a8a-8bad-23b659bafc10" xlink:to="loc_us-gaap_AssetsCurrent_7e931151-ee85-4f35-a1de-2e9d8ea2c7d2" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_83e34aa9-09ca-48fa-aa08-1f8e40311bf7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_aa4957b0-4fd5-49ee-a25b-d086d5fb8950" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_83e34aa9-09ca-48fa-aa08-1f8e40311bf7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_ac401255-216f-4fb9-bc0f-8b5b1de02c44" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_aa4957b0-4fd5-49ee-a25b-d086d5fb8950" xlink:to="loc_us-gaap_Goodwill_ac401255-216f-4fb9-bc0f-8b5b1de02c44" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_8059ac4f-ce68-429d-a015-d00b8fd5588b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IntangibleAssetsNetExcludingGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_aa4957b0-4fd5-49ee-a25b-d086d5fb8950" xlink:to="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_8059ac4f-ce68-429d-a015-d00b8fd5588b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssetsNoncurrent_2ee22e84-b816-4a44-8c86-8834d241ab54" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherAssetsNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_aa4957b0-4fd5-49ee-a25b-d086d5fb8950" xlink:to="loc_us-gaap_OtherAssetsNoncurrent_2ee22e84-b816-4a44-8c86-8834d241ab54" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxAssetsNet_6cab1375-e7d0-4861-a7f5-57c0b4a60000" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredIncomeTaxAssetsNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_aa4957b0-4fd5-49ee-a25b-d086d5fb8950" xlink:to="loc_us-gaap_DeferredIncomeTaxAssetsNet_6cab1375-e7d0-4861-a7f5-57c0b4a60000" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_a37d9ee6-7eac-4f89-9e5a-7dbda33ed25f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Assets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_aa4957b0-4fd5-49ee-a25b-d086d5fb8950" xlink:to="loc_us-gaap_Assets_a37d9ee6-7eac-4f89-9e5a-7dbda33ed25f" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_22f7a2f9-04b7-4309-a23b-89ddb419268b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesAndStockholdersEquityAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_2eb6934b-3208-4e85-9e72-28e641fa5bc2" xlink:to="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_22f7a2f9-04b7-4309-a23b-89ddb419268b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrentAbstract_035c245a-7d14-44c6-8250-ae53a959fc2d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesCurrentAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_22f7a2f9-04b7-4309-a23b-89ddb419268b" xlink:to="loc_us-gaap_LiabilitiesCurrentAbstract_035c245a-7d14-44c6-8250-ae53a959fc2d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableCurrent_6c3be341-1d0c-4060-a720-a14aafc814d0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccountsPayableCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_035c245a-7d14-44c6-8250-ae53a959fc2d" xlink:to="loc_us-gaap_AccountsPayableCurrent_6c3be341-1d0c-4060-a720-a14aafc814d0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent_0174f3f0-9858-45a6-a96e-fd75e2f5c727" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_035c245a-7d14-44c6-8250-ae53a959fc2d" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrent_0174f3f0-9858-45a6-a96e-fd75e2f5c727" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedIncomeTaxesCurrent_eabc7c20-db9c-4cd7-b469-69c26bac11ca" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccruedIncomeTaxesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_035c245a-7d14-44c6-8250-ae53a959fc2d" xlink:to="loc_us-gaap_AccruedIncomeTaxesCurrent_eabc7c20-db9c-4cd7-b469-69c26bac11ca" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermBorrowings_bbe23026-e074-4d46-8958-ccb2e2d0f01a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShortTermBorrowings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_035c245a-7d14-44c6-8250-ae53a959fc2d" xlink:to="loc_us-gaap_ShortTermBorrowings_bbe23026-e074-4d46-8958-ccb2e2d0f01a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtCurrent_19919342-02fe-4258-9502-f8755ffa9e8d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebtCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_035c245a-7d14-44c6-8250-ae53a959fc2d" xlink:to="loc_us-gaap_LongTermDebtCurrent_19919342-02fe-4258-9502-f8755ffa9e8d" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_3f46fe6d-d267-464f-b4f7-0a5da7ac8300" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_035c245a-7d14-44c6-8250-ae53a959fc2d" xlink:to="loc_us-gaap_LiabilitiesCurrent_3f46fe6d-d267-464f-b4f7-0a5da7ac8300" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtAndCapitalLeaseObligations_f78851bc-647e-4558-a93f-ad982d3c370e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebtAndCapitalLeaseObligations"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_22f7a2f9-04b7-4309-a23b-89ddb419268b" xlink:to="loc_us-gaap_LongTermDebtAndCapitalLeaseObligations_f78851bc-647e-4558-a93f-ad982d3c370e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilitiesNoncurrent_97d8a4d6-1d69-403b-ba14-c5b98fb7097f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherLiabilitiesNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_22f7a2f9-04b7-4309-a23b-89ddb419268b" xlink:to="loc_us-gaap_OtherLiabilitiesNoncurrent_97d8a4d6-1d69-403b-ba14-c5b98fb7097f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_def738d6-f673-44d6-bf99-19bac6657185" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_22f7a2f9-04b7-4309-a23b-89ddb419268b" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_def738d6-f673-44d6-bf99-19bac6657185" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_82a741ed-1e20-457d-abd3-bf14ed98cf8b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Liabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_22f7a2f9-04b7-4309-a23b-89ddb419268b" xlink:to="loc_us-gaap_Liabilities_82a741ed-1e20-457d-abd3-bf14ed98cf8b" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_515abaaa-9b32-4bf9-810c-ca874332fed8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_22f7a2f9-04b7-4309-a23b-89ddb419268b" xlink:to="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_515abaaa-9b32-4bf9-810c-ca874332fed8" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockValue_8866d303-051f-4d62-af28-53a34c722bcb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PreferredStockValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_515abaaa-9b32-4bf9-810c-ca874332fed8" xlink:to="loc_us-gaap_PreferredStockValue_8866d303-051f-4d62-af28-53a34c722bcb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValue_c41ab393-3e4c-4903-9f3a-41b22cf72b00" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_515abaaa-9b32-4bf9-810c-ca874332fed8" xlink:to="loc_us-gaap_CommonStockValue_c41ab393-3e4c-4903-9f3a-41b22cf72b00" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapital_d2dcbc2d-c33e-4f0d-b212-57b2c74d6ed7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AdditionalPaidInCapital"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_515abaaa-9b32-4bf9-810c-ca874332fed8" xlink:to="loc_us-gaap_AdditionalPaidInCapital_d2dcbc2d-c33e-4f0d-b212-57b2c74d6ed7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_718a8af7-c69d-4e70-b787-7ca5dc4b7dbb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_515abaaa-9b32-4bf9-810c-ca874332fed8" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_718a8af7-c69d-4e70-b787-7ca5dc4b7dbb" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockCommonValue_76ff2774-c572-4727-8eaf-a194b41e8119" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TreasuryStockCommonValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_515abaaa-9b32-4bf9-810c-ca874332fed8" xlink:to="loc_us-gaap_TreasuryStockCommonValue_76ff2774-c572-4727-8eaf-a194b41e8119" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_5f2fc706-b663-4070-b0bf-20b9051bc14e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_515abaaa-9b32-4bf9-810c-ca874332fed8" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_5f2fc706-b663-4070-b0bf-20b9051bc14e" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_194db062-5fbb-4855-974f-f454d5292120" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_515abaaa-9b32-4bf9-810c-ca874332fed8" xlink:to="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_194db062-5fbb-4855-974f-f454d5292120" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_79b00436-bd8f-4e47-ace7-8477b0dd9d72" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_22f7a2f9-04b7-4309-a23b-89ddb419268b" xlink:to="loc_us-gaap_LiabilitiesAndStockholdersEquity_79b00436-bd8f-4e47-ace7-8477b0dd9d72" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_f81f3f27-b72f-4ed8-9035-2abf07fb312b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_2eb6934b-3208-4e85-9e72-28e641fa5bc2" xlink:to="loc_us-gaap_StatementTable_f81f3f27-b72f-4ed8-9035-2abf07fb312b" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_1a3d42dd-2ce2-49f4-bc7b-11819daceb72" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_f81f3f27-b72f-4ed8-9035-2abf07fb312b" xlink:to="loc_us-gaap_StatementClassOfStockAxis_1a3d42dd-2ce2-49f4-bc7b-11819daceb72" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_1a3d42dd-2ce2-49f4-bc7b-11819daceb72_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_1a3d42dd-2ce2-49f4-bc7b-11819daceb72" xlink:to="loc_us-gaap_ClassOfStockDomain_1a3d42dd-2ce2-49f4-bc7b-11819daceb72_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_7923082d-c64d-4afc-bf21-67fd6fd36ec2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_1a3d42dd-2ce2-49f4-bc7b-11819daceb72" xlink:to="loc_us-gaap_ClassOfStockDomain_7923082d-c64d-4afc-bf21-67fd6fd36ec2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_44395618-3b4c-4762-9db6-a47884b5c97f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_7923082d-c64d-4afc-bf21-67fd6fd36ec2" xlink:to="loc_us-gaap_CommonStockMember_44395618-3b4c-4762-9db6-a47884b5c97f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_5dac1881-ddf4-40fe-9100-d57e40d0a44a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_7923082d-c64d-4afc-bf21-67fd6fd36ec2" xlink:to="loc_us-gaap_CommonClassBMember_5dac1881-ddf4-40fe-9100-d57e40d0a44a" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETSParenthetical" xlink:type="simple" xlink:href="hsy-20221002.xsd#CONSOLIDATEDBALANCESHEETSParenthetical"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETSParenthetical" xlink:type="extended" id="i4796c548974a4aaabe3cb871a5de022d_CONSOLIDATEDBALANCESHEETSParenthetical">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_c2a6a63c-aa18-4582-96cd-e39b93484b1e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockSharesIssued_e1c7426c-4218-49b3-8674-750b2697c869" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PreferredStockSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_c2a6a63c-aa18-4582-96cd-e39b93484b1e" xlink:to="loc_us-gaap_PreferredStockSharesIssued_e1c7426c-4218-49b3-8674-750b2697c869" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesIssued_481319e7-cb2f-4a6d-ac78-49ae47c0aa96" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_c2a6a63c-aa18-4582-96cd-e39b93484b1e" xlink:to="loc_us-gaap_CommonStockSharesIssued_481319e7-cb2f-4a6d-ac78-49ae47c0aa96" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockCommonShares_0477c384-61a8-4968-b5ee-26f95d37b524" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TreasuryStockCommonShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_c2a6a63c-aa18-4582-96cd-e39b93484b1e" xlink:to="loc_us-gaap_TreasuryStockCommonShares_0477c384-61a8-4968-b5ee-26f95d37b524" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_9ed8f4ee-c393-40f5-9815-96a5039c4b04" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_c2a6a63c-aa18-4582-96cd-e39b93484b1e" xlink:to="loc_us-gaap_StatementTable_9ed8f4ee-c393-40f5-9815-96a5039c4b04" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_0fd69e0d-0e54-4b2e-a973-dd293b8340ee" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_9ed8f4ee-c393-40f5-9815-96a5039c4b04" xlink:to="loc_us-gaap_StatementClassOfStockAxis_0fd69e0d-0e54-4b2e-a973-dd293b8340ee" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_0fd69e0d-0e54-4b2e-a973-dd293b8340ee_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_0fd69e0d-0e54-4b2e-a973-dd293b8340ee" xlink:to="loc_us-gaap_ClassOfStockDomain_0fd69e0d-0e54-4b2e-a973-dd293b8340ee_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_644b8a15-9e04-439b-8815-207a25e3aa97" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_0fd69e0d-0e54-4b2e-a973-dd293b8340ee" xlink:to="loc_us-gaap_ClassOfStockDomain_644b8a15-9e04-439b-8815-207a25e3aa97" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_5c63263e-8efe-4ee7-b81e-835fd2347437" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_644b8a15-9e04-439b-8815-207a25e3aa97" xlink:to="loc_us-gaap_CommonStockMember_5c63263e-8efe-4ee7-b81e-835fd2347437" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_92f3270b-9451-40ae-8038-69f2c47a2790" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_644b8a15-9e04-439b-8815-207a25e3aa97" xlink:to="loc_us-gaap_CommonClassBMember_92f3270b-9451-40ae-8038-69f2c47a2790" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY" xlink:type="simple" xlink:href="hsy-20221002.xsd#CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY" xlink:type="extended" id="ie69aa1aeaf04409b8ec6a3b0a4ccf97a_CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_e69ce0c2-9dc7-4392-9970-1072ff68ed5d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInStockholdersEquityRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_e69ce0c2-9dc7-4392-9970-1072ff68ed5d" xlink:to="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_2d57b63a-b882-4c6c-acd6-cbd97a27ec92" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:to="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_2d57b63a-b882-4c6c-acd6-cbd97a27ec92" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProfitLoss_14ed0976-48f2-4cc3-b7dc-e8c210427324" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ProfitLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:to="loc_us-gaap_ProfitLoss_14ed0976-48f2-4cc3-b7dc-e8c210427324" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossBeforeReclassificationsNetOfTax_fc833b97-7743-451e-b6b4-a7cc4d4fe921" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherComprehensiveIncomeLossBeforeReclassificationsNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossBeforeReclassificationsNetOfTax_fc833b97-7743-451e-b6b4-a7cc4d4fe921" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStockAbstract_8ec7edee-ebcd-4dbb-b008-b87b98f29197" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DividendsCommonStockAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:to="loc_us-gaap_DividendsCommonStockAbstract_8ec7edee-ebcd-4dbb-b008-b87b98f29197" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStockCash_fa3cd03f-48df-45bc-b71b-3f36f6dd75c0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DividendsCommonStockCash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DividendsCommonStockAbstract_8ec7edee-ebcd-4dbb-b008-b87b98f29197" xlink:to="loc_us-gaap_DividendsCommonStockCash_fa3cd03f-48df-45bc-b71b-3f36f6dd75c0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueConversionOfConvertibleSecurities_686d6952-4884-479d-9641-403b191689b0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockIssuedDuringPeriodValueConversionOfConvertibleSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueConversionOfConvertibleSecurities_686d6952-4884-479d-9641-403b191689b0" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_58762b1a-293d-411f-b3a5-536e2b98a361" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:to="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_58762b1a-293d-411f-b3a5-536e2b98a361" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised_3cea7c63-a361-4289-8ae2-94f8715cd28e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised_3cea7c63-a361-4289-8ae2-94f8715cd28e" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockValueAcquiredCostMethod_00ee93d5-f4f2-4d6f-a335-25c8e4cba9c1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TreasuryStockValueAcquiredCostMethod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:to="loc_us-gaap_TreasuryStockValueAcquiredCostMethod_00ee93d5-f4f2-4d6f-a335-25c8e4cba9c1" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoncontrollingInterestDecreaseFromDeconsolidation_7ed03858-f320-4832-b00a-f6ad832bd2cd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NoncontrollingInterestDecreaseFromDeconsolidation"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_659b23fb-cf3a-4cc0-ad6f-4431973e5971" xlink:to="loc_us-gaap_NoncontrollingInterestDecreaseFromDeconsolidation_7ed03858-f320-4832-b00a-f6ad832bd2cd" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_f05d6abf-b230-43f4-8edd-6848361da52c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_e792e2e6-4ebb-48a6-9fb5-936f7d6c4b67" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_e69ce0c2-9dc7-4392-9970-1072ff68ed5d" xlink:to="loc_us-gaap_StatementTable_e792e2e6-4ebb-48a6-9fb5-936f7d6c4b67" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_769a7778-b399-4af5-9193-098598896e97" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_e792e2e6-4ebb-48a6-9fb5-936f7d6c4b67" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_769a7778-b399-4af5-9193-098598896e97" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_769a7778-b399-4af5-9193-098598896e97_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_769a7778-b399-4af5-9193-098598896e97" xlink:to="loc_us-gaap_EquityComponentDomain_769a7778-b399-4af5-9193-098598896e97_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_8692fc4a-f120-419d-9aea-c0a6dd3ac27e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_769a7778-b399-4af5-9193-098598896e97" xlink:to="loc_us-gaap_EquityComponentDomain_8692fc4a-f120-419d-9aea-c0a6dd3ac27e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockMember_5680cc4a-1487-40f4-a409-8b347e7fc445" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PreferredStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_8692fc4a-f120-419d-9aea-c0a6dd3ac27e" xlink:to="loc_us-gaap_PreferredStockMember_5680cc4a-1487-40f4-a409-8b347e7fc445" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_6b019df7-f725-452e-95af-396099e588d6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_8692fc4a-f120-419d-9aea-c0a6dd3ac27e" xlink:to="loc_us-gaap_CommonStockMember_6b019df7-f725-452e-95af-396099e588d6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapitalMember_f408e872-10d2-4428-abd0-558f438b9e8c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AdditionalPaidInCapitalMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_8692fc4a-f120-419d-9aea-c0a6dd3ac27e" xlink:to="loc_us-gaap_AdditionalPaidInCapitalMember_f408e872-10d2-4428-abd0-558f438b9e8c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsMember_be2cfb77-5d6f-4dec-b0d1-f6f3ddce1394" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetainedEarningsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_8692fc4a-f120-419d-9aea-c0a6dd3ac27e" xlink:to="loc_us-gaap_RetainedEarningsMember_be2cfb77-5d6f-4dec-b0d1-f6f3ddce1394" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockCommonMember_fe5f61c4-d48c-4a16-a7e8-2ff052de7da8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TreasuryStockCommonMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_8692fc4a-f120-419d-9aea-c0a6dd3ac27e" xlink:to="loc_us-gaap_TreasuryStockCommonMember_fe5f61c4-d48c-4a16-a7e8-2ff052de7da8" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_ceed102c-d713-4026-9d20-dcef7a472177" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_8692fc4a-f120-419d-9aea-c0a6dd3ac27e" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_ceed102c-d713-4026-9d20-dcef7a472177" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoncontrollingInterestMember_16918677-1489-4712-864c-c4571a63f49c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NoncontrollingInterestMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_8692fc4a-f120-419d-9aea-c0a6dd3ac27e" xlink:to="loc_us-gaap_NoncontrollingInterestMember_16918677-1489-4712-864c-c4571a63f49c" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_6e12fbd8-a931-40ae-ad8a-34fc763bf601" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_e792e2e6-4ebb-48a6-9fb5-936f7d6c4b67" xlink:to="loc_us-gaap_StatementClassOfStockAxis_6e12fbd8-a931-40ae-ad8a-34fc763bf601" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_6e12fbd8-a931-40ae-ad8a-34fc763bf601_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_6e12fbd8-a931-40ae-ad8a-34fc763bf601" xlink:to="loc_us-gaap_ClassOfStockDomain_6e12fbd8-a931-40ae-ad8a-34fc763bf601_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_1801964d-2b0c-4a5e-abdf-84ee5be565af" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_6e12fbd8-a931-40ae-ad8a-34fc763bf601" xlink:to="loc_us-gaap_ClassOfStockDomain_1801964d-2b0c-4a5e-abdf-84ee5be565af" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_13ddab62-248a-4a0a-a760-b8d7677be416" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_1801964d-2b0c-4a5e-abdf-84ee5be565af" xlink:to="loc_us-gaap_CommonStockMember_13ddab62-248a-4a0a-a760-b8d7677be416" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_eec1b839-ba47-4ac0-8eb0-cdd381dc114d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_1801964d-2b0c-4a5e-abdf-84ee5be565af" xlink:to="loc_us-gaap_CommonClassBMember_eec1b839-ba47-4ac0-8eb0-cdd381dc114d" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical" xlink:type="simple" xlink:href="hsy-20221002.xsd#CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical" xlink:type="extended" id="i20498734a8ed4ce394f970c6307336f0_CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_21e794b2-d469-4484-90e0-c1495920909f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockDividendsPerShareCashPaid_d225979d-4c32-4df8-a561-d75d696041cf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockDividendsPerShareCashPaid"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_21e794b2-d469-4484-90e0-c1495920909f" xlink:to="loc_us-gaap_CommonStockDividendsPerShareCashPaid_d225979d-4c32-4df8-a561-d75d696041cf" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_456a79e3-6c0d-4d24-b9ab-78b3d510131f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_21e794b2-d469-4484-90e0-c1495920909f" xlink:to="loc_us-gaap_StatementTable_456a79e3-6c0d-4d24-b9ab-78b3d510131f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_c5ca26b2-e372-4536-80c1-473e090f6227" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_456a79e3-6c0d-4d24-b9ab-78b3d510131f" xlink:to="loc_us-gaap_StatementClassOfStockAxis_c5ca26b2-e372-4536-80c1-473e090f6227" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_c5ca26b2-e372-4536-80c1-473e090f6227_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_c5ca26b2-e372-4536-80c1-473e090f6227" xlink:to="loc_us-gaap_ClassOfStockDomain_c5ca26b2-e372-4536-80c1-473e090f6227_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_e42d3ad0-3534-44c5-8849-4f922f9ec4fb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_c5ca26b2-e372-4536-80c1-473e090f6227" xlink:to="loc_us-gaap_ClassOfStockDomain_e42d3ad0-3534-44c5-8849-4f922f9ec4fb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_8bafc423-7551-4958-8947-afa76c71a96e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_e42d3ad0-3534-44c5-8849-4f922f9ec4fb" xlink:to="loc_us-gaap_CommonStockMember_8bafc423-7551-4958-8947-afa76c71a96e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_5869c2e2-034c-489b-afd2-25a8cfb9c87c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_e42d3ad0-3534-44c5-8849-4f922f9ec4fb" xlink:to="loc_us-gaap_CommonClassBMember_5869c2e2-034c-489b-afd2-25a8cfb9c87c" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESPRETZELSINCNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#BUSINESSACQUISITIONANDDIVESTITURESPRETZELSINCNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESPRETZELSINCNARRATIVEDetails" xlink:type="extended" id="i855b07982b354deb94321e2a30261601_BUSINESSACQUISITIONANDDIVESTITURESPRETZELSINCNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_154ee5be-8ed2-4823-b64b-d15d92021a74" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_BusinessCombinationNumberOfManufacturingLocations_2c65facb-d94d-4b9b-953b-3f343f033ebd" xlink:href="hsy-20221002.xsd#hsy_BusinessCombinationNumberOfManufacturingLocations"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_154ee5be-8ed2-4823-b64b-d15d92021a74" xlink:to="loc_hsy_BusinessCombinationNumberOfManufacturingLocations_2c65facb-d94d-4b9b-953b-3f343f033ebd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferred1_b1a590f8-0534-4982-a5bc-671801725846" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationConsiderationTransferred1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_154ee5be-8ed2-4823-b64b-d15d92021a74" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferred1_b1a590f8-0534-4982-a5bc-671801725846" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedTrademarksGross_64d0924e-53fc-49aa-ba1e-04d651917320" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedTrademarksGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_154ee5be-8ed2-4823-b64b-d15d92021a74" xlink:to="loc_us-gaap_FiniteLivedTrademarksGross_64d0924e-53fc-49aa-ba1e-04d651917320" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_8a7b9141-3ebd-431e-94d2-03c1e6d1a57e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedCustomerRelationshipsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_154ee5be-8ed2-4823-b64b-d15d92021a74" xlink:to="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_8a7b9141-3ebd-431e-94d2-03c1e6d1a57e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_d4f25380-909a-4f88-a719-46a027a18e5e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_154ee5be-8ed2-4823-b64b-d15d92021a74" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_d4f25380-909a-4f88-a719-46a027a18e5e" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_370b84d0-1556-4ba7-adfd-81f1c8a8c3ec" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_154ee5be-8ed2-4823-b64b-d15d92021a74" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_370b84d0-1556-4ba7-adfd-81f1c8a8c3ec" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_2fa82e78-d809-46ab-85ab-ed4f4b846558" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_370b84d0-1556-4ba7-adfd-81f1c8a8c3ec" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_2fa82e78-d809-46ab-85ab-ed4f4b846558" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_2fa82e78-d809-46ab-85ab-ed4f4b846558_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_2fa82e78-d809-46ab-85ab-ed4f4b846558" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_2fa82e78-d809-46ab-85ab-ed4f4b846558_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_af3fe649-a197-4236-a134-3cb6b55b47f7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_2fa82e78-d809-46ab-85ab-ed4f4b846558" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_af3fe649-a197-4236-a134-3cb6b55b47f7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PretzelsIncMember_1267d479-1bce-4ba2-a64d-bf4dda55b659" xlink:href="hsy-20221002.xsd#hsy_PretzelsIncMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_af3fe649-a197-4236-a134-3cb6b55b47f7" xlink:to="loc_hsy_PretzelsIncMember_1267d479-1bce-4ba2-a64d-bf4dda55b659" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_2c752d8c-07b9-4e3a-8846-ca04162b95a8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_370b84d0-1556-4ba7-adfd-81f1c8a8c3ec" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_2c752d8c-07b9-4e3a-8846-ca04162b95a8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_2c752d8c-07b9-4e3a-8846-ca04162b95a8_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_2c752d8c-07b9-4e3a-8846-ca04162b95a8" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_2c752d8c-07b9-4e3a-8846-ca04162b95a8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_33ba70f7-333a-45a3-96ea-06f97f00b5be" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_2c752d8c-07b9-4e3a-8846-ca04162b95a8" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_33ba70f7-333a-45a3-96ea-06f97f00b5be" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_50c8ba6f-f9c5-4f79-adac-7c011a3ea9bd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_33ba70f7-333a-45a3-96ea-06f97f00b5be" xlink:to="loc_us-gaap_TrademarksMember_50c8ba6f-f9c5-4f79-adac-7c011a3ea9bd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelationshipsMember_18aea9c2-bd54-4da9-9dcf-2a54b75ecd4f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CustomerRelationshipsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_33ba70f7-333a-45a3-96ea-06f97f00b5be" xlink:to="loc_us-gaap_CustomerRelationshipsMember_18aea9c2-bd54-4da9-9dcf-2a54b75ecd4f" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITUREPRETZELSINCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#BUSINESSACQUISITIONSANDDIVESTITUREPRETZELSINCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITUREPRETZELSINCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="extended" id="ia57b1f7d36914f6f9f513bad75e3900f_BUSINESSACQUISITIONSANDDIVESTITUREPRETZELSINCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_bedcf207-a936-410b-a959-270daa3b6f2a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_Goodwill_bedcf207-a936-410b-a959-270daa3b6f2a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_ddc424a3-9e89-4030-8776-b8731a3e98dd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GoodwillPurchaseAccountingAdjustments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_ddc424a3-9e89-4030-8776-b8731a3e98dd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_49f66e3a-8af3-4339-9bd1-3cc326383320" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_49f66e3a-8af3-4339-9bd1-3cc326383320" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles_433db0dc-9783-4abc-93b4-a878f13582ba" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles_433db0dc-9783-4abc-93b4-a878f13582ba" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets_2569b6ee-c464-4812-9c00-339e1856dc7c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets_2569b6ee-c464-4812-9c00-339e1856dc7c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentAssets_08749f0f-e02e-4d90-99d5-10a3cc164e6a" xlink:href="hsy-20221002.xsd#hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentAssets_08749f0f-e02e-4d90-99d5-10a3cc164e6a" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment_ad3408f6-afa0-49db-a5b3-4a5b66e346be" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment_ad3408f6-afa0-49db-a5b3-4a5b66e346be" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment_62a3506b-a5b5-492c-bcd4-7fe34088df6c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment_62a3506b-a5b5-492c-bcd4-7fe34088df6c" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets_2b380b33-dd7e-4153-aae7-bc6fe479f56a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets_2b380b33-dd7e-4153-aae7-bc6fe479f56a" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxAssets_b2488b68-1e85-44b3-8a32-02cd7ea7749d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxAssets_b2488b68-1e85-44b3-8a32-02cd7ea7749d" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteDeferredIncomeTaxes_19cc97cb-8beb-47a0-a46a-22231f87f733" xlink:href="hsy-20221002.xsd#hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteDeferredIncomeTaxes"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteDeferredIncomeTaxes_19cc97cb-8beb-47a0-a46a-22231f87f733" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilities_efebc09f-3f72-4d72-a4e5-adb55c952a8c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilities_efebc09f-3f72-4d72-a4e5-adb55c952a8c" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNoncurrentLiabilitiesOther_42a0e428-1f60-4ff9-828a-5257d49c5e4e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNoncurrentLiabilitiesOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNoncurrentLiabilitiesOther_42a0e428-1f60-4ff9-828a-5257d49c5e4e" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_f5564be2-2806-4c13-bbd2-f74cc69eb2d0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_f5564be2-2806-4c13-bbd2-f74cc69eb2d0" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred_09bd5703-1929-4225-a796-993a00690383" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred_09bd5703-1929-4225-a796-993a00690383" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8a7c0097-54a1-4d47-b7a3-7109900e6f5c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2bed3716-2108-43f5-a237-f8ad0271b213" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8a7c0097-54a1-4d47-b7a3-7109900e6f5c" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_5bd186fe-e525-41cf-9f7f-78aab3488283" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8a7c0097-54a1-4d47-b7a3-7109900e6f5c" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_5bd186fe-e525-41cf-9f7f-78aab3488283" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_5bd186fe-e525-41cf-9f7f-78aab3488283_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_5bd186fe-e525-41cf-9f7f-78aab3488283" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_5bd186fe-e525-41cf-9f7f-78aab3488283_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_83541160-d1ab-4c94-a9a2-5fd48bbce0f6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_5bd186fe-e525-41cf-9f7f-78aab3488283" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_83541160-d1ab-4c94-a9a2-5fd48bbce0f6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PretzelsIncMember_388bcfa1-c1e9-4057-b051-2083970b8622" xlink:href="hsy-20221002.xsd#hsy_PretzelsIncMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_83541160-d1ab-4c94-a9a2-5fd48bbce0f6" xlink:to="loc_hsy_PretzelsIncMember_388bcfa1-c1e9-4057-b051-2083970b8622" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESDOTSPRETZELSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#BUSINESSACQUISITIONANDDIVESTITURESDOTSPRETZELSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESDOTSPRETZELSNARRATIVEDetails" xlink:type="extended" id="idc03a6f593de43a499c6c191c87e8e2a_BUSINESSACQUISITIONANDDIVESTITURESDOTSPRETZELSNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_03c2ed45-225b-4cc5-a523-4470aaf86182" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferred1_a900fb2c-7822-450c-a07c-fadc7582278b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationConsiderationTransferred1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_03c2ed45-225b-4cc5-a523-4470aaf86182" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferred1_a900fb2c-7822-450c-a07c-fadc7582278b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedTrademarksGross_d1cc8569-25a6-4085-b9ac-1c6a51743ed5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedTrademarksGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_03c2ed45-225b-4cc5-a523-4470aaf86182" xlink:to="loc_us-gaap_FiniteLivedTrademarksGross_d1cc8569-25a6-4085-b9ac-1c6a51743ed5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_328a3be1-4ac1-48b7-b89c-f3b5a9d4b8e7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedCustomerRelationshipsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_03c2ed45-225b-4cc5-a523-4470aaf86182" xlink:to="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_328a3be1-4ac1-48b7-b89c-f3b5a9d4b8e7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_58448f5f-6038-4240-8be8-316342f9b03e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_03c2ed45-225b-4cc5-a523-4470aaf86182" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_58448f5f-6038-4240-8be8-316342f9b03e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_0c2c4469-f08a-44b9-accc-92ca29280ab3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_03c2ed45-225b-4cc5-a523-4470aaf86182" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_0c2c4469-f08a-44b9-accc-92ca29280ab3" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_0aae023c-6eac-431a-b1a3-2142fc2eda7a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_0c2c4469-f08a-44b9-accc-92ca29280ab3" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_0aae023c-6eac-431a-b1a3-2142fc2eda7a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_0aae023c-6eac-431a-b1a3-2142fc2eda7a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_0aae023c-6eac-431a-b1a3-2142fc2eda7a" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_0aae023c-6eac-431a-b1a3-2142fc2eda7a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_490cb77c-407f-4a9e-9eec-1654a5240f59" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_0aae023c-6eac-431a-b1a3-2142fc2eda7a" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_490cb77c-407f-4a9e-9eec-1654a5240f59" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DotsPretzelsLLCMember_0fff4e4c-fca8-4b17-b722-cf130f358e52" xlink:href="hsy-20221002.xsd#hsy_DotsPretzelsLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_490cb77c-407f-4a9e-9eec-1654a5240f59" xlink:to="loc_hsy_DotsPretzelsLLCMember_0fff4e4c-fca8-4b17-b722-cf130f358e52" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_f8dff4f8-fc43-487a-8e67-29742e9a8385" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_0c2c4469-f08a-44b9-accc-92ca29280ab3" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_f8dff4f8-fc43-487a-8e67-29742e9a8385" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_f8dff4f8-fc43-487a-8e67-29742e9a8385_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_f8dff4f8-fc43-487a-8e67-29742e9a8385" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_f8dff4f8-fc43-487a-8e67-29742e9a8385_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_b1cc5dc1-ec10-477e-a0d5-9ffea5bd8f27" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_f8dff4f8-fc43-487a-8e67-29742e9a8385" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_b1cc5dc1-ec10-477e-a0d5-9ffea5bd8f27" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_57700e94-ed2c-4da8-8202-258431b4008a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_b1cc5dc1-ec10-477e-a0d5-9ffea5bd8f27" xlink:to="loc_us-gaap_TrademarksMember_57700e94-ed2c-4da8-8202-258431b4008a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelationshipsMember_dc4a41e7-9e84-4173-9227-ce4e2a97fcdf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CustomerRelationshipsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_b1cc5dc1-ec10-477e-a0d5-9ffea5bd8f27" xlink:to="loc_us-gaap_CustomerRelationshipsMember_dc4a41e7-9e84-4173-9227-ce4e2a97fcdf" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITUREDOTSPRETZELSASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#BUSINESSACQUISITIONSANDDIVESTITUREDOTSPRETZELSASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITUREDOTSPRETZELSASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="extended" id="ifec89de5b40147f6a6a38eae3db0f826_BUSINESSACQUISITIONSANDDIVESTITUREDOTSPRETZELSASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_eb5f85f1-08c2-4bcc-97d6-e9ab26b67d80" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_Goodwill_eb5f85f1-08c2-4bcc-97d6-e9ab26b67d80" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_d3f4e051-59a4-4428-94a3-cd744c59a267" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GoodwillPurchaseAccountingAdjustments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_d3f4e051-59a4-4428-94a3-cd744c59a267" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_a9a7e46e-d2fd-4203-a0c8-10a9f757e421" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_a9a7e46e-d2fd-4203-a0c8-10a9f757e421" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles_52bbe757-00f4-4808-81c0-f2d33b4b8582" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles_52bbe757-00f4-4808-81c0-f2d33b4b8582" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets_1cf7188e-3a7e-4b68-a3a1-cb6c3c1b556e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets_1cf7188e-3a7e-4b68-a3a1-cb6c3c1b556e" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment_50960823-716a-4f88-b462-6762cb110521" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment_50960823-716a-4f88-b462-6762cb110521" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment_7be97e55-5c3a-4725-919b-65af89ddf10d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment_7be97e55-5c3a-4725-919b-65af89ddf10d" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets_975a28b8-6176-4b3f-bdd1-dd9e57ab7ecf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets_975a28b8-6176-4b3f-bdd1-dd9e57ab7ecf" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther_e1d5ce65-66c4-4476-9cdb-2909691b29ab" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther_e1d5ce65-66c4-4476-9cdb-2909691b29ab" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentLiabilitiesOther_bba46bf2-aecf-4ea7-8d86-0823c9ed9164" xlink:href="hsy-20221002.xsd#hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentLiabilitiesOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentLiabilitiesOther_bba46bf2-aecf-4ea7-8d86-0823c9ed9164" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_49a59857-d0ca-4e4d-b1c9-0d3ef8c6206c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_49a59857-d0ca-4e4d-b1c9-0d3ef8c6206c" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred_a9bf15e7-b74a-43f1-80e8-beb4b01d0851" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred_a9bf15e7-b74a-43f1-80e8-beb4b01d0851" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8b2f7ec1-aa3a-4871-b1fb-758a0cbafa7a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2927fad8-00fe-4889-9480-2e2a9d0ca2e5" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8b2f7ec1-aa3a-4871-b1fb-758a0cbafa7a" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_33d06260-7b05-4f04-9064-6f7ee8787211" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8b2f7ec1-aa3a-4871-b1fb-758a0cbafa7a" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_33d06260-7b05-4f04-9064-6f7ee8787211" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_33d06260-7b05-4f04-9064-6f7ee8787211_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_33d06260-7b05-4f04-9064-6f7ee8787211" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_33d06260-7b05-4f04-9064-6f7ee8787211_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_43f773bd-8ec9-4e11-855d-b488d516fedb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_33d06260-7b05-4f04-9064-6f7ee8787211" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_43f773bd-8ec9-4e11-855d-b488d516fedb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DotsPretzelsLLCMember_e1a42e54-8de9-4b42-af27-7f3d71d0d564" xlink:href="hsy-20221002.xsd#hsy_DotsPretzelsLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_43f773bd-8ec9-4e11-855d-b488d516fedb" xlink:to="loc_hsy_DotsPretzelsLLCMember_e1a42e54-8de9-4b42-af27-7f3d71d0d564" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITURELILYSSWEETSLLCNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#BUSINESSACQUISITIONSANDDIVESTITURELILYSSWEETSLLCNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITURELILYSSWEETSLLCNARRATIVEDetails" xlink:type="extended" id="ib625d1eb389b43bb995845f443e62791_BUSINESSACQUISITIONSANDDIVESTITURELILYSSWEETSLLCNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_dabe79e3-a920-4a74-bf66-c691454b06c4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferred1_81715117-d430-4f47-9eeb-bbac00406206" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationConsiderationTransferred1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_dabe79e3-a920-4a74-bf66-c691454b06c4" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferred1_81715117-d430-4f47-9eeb-bbac00406206" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_7bfda8aa-2bcb-4351-88c7-4b5635f9efdd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationContingentConsiderationLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_dabe79e3-a920-4a74-bf66-c691454b06c4" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_7bfda8aa-2bcb-4351-88c7-4b5635f9efdd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedTrademarksGross_bba4e913-c711-4de5-a92b-8bea8f92b5df" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedTrademarksGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_dabe79e3-a920-4a74-bf66-c691454b06c4" xlink:to="loc_us-gaap_FiniteLivedTrademarksGross_bba4e913-c711-4de5-a92b-8bea8f92b5df" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_52097e09-26f1-4d86-ace5-f8c958ce7ad5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedCustomerRelationshipsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_dabe79e3-a920-4a74-bf66-c691454b06c4" xlink:to="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_52097e09-26f1-4d86-ace5-f8c958ce7ad5" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_70f567ab-720e-4e67-a64a-1923c7a00d6c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_dabe79e3-a920-4a74-bf66-c691454b06c4" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_70f567ab-720e-4e67-a64a-1923c7a00d6c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8e604d4e-6c39-4a48-9c3b-c8c5b906a0e3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_dabe79e3-a920-4a74-bf66-c691454b06c4" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8e604d4e-6c39-4a48-9c3b-c8c5b906a0e3" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_d85de7a9-35f4-43a7-af97-a9c0df111f86" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8e604d4e-6c39-4a48-9c3b-c8c5b906a0e3" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_d85de7a9-35f4-43a7-af97-a9c0df111f86" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_d85de7a9-35f4-43a7-af97-a9c0df111f86_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_d85de7a9-35f4-43a7-af97-a9c0df111f86" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_d85de7a9-35f4-43a7-af97-a9c0df111f86_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_bc5e1561-457a-416a-aa60-9097391fe2fc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_d85de7a9-35f4-43a7-af97-a9c0df111f86" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_bc5e1561-457a-416a-aa60-9097391fe2fc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LilysSweetsLLCMember_5d508026-a6ce-4252-8a7d-1889f9cb1991" xlink:href="hsy-20221002.xsd#hsy_LilysSweetsLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_bc5e1561-457a-416a-aa60-9097391fe2fc" xlink:to="loc_hsy_LilysSweetsLLCMember_5d508026-a6ce-4252-8a7d-1889f9cb1991" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_da340fbe-46d9-4cb1-810a-adefe3b7a895" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8e604d4e-6c39-4a48-9c3b-c8c5b906a0e3" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_da340fbe-46d9-4cb1-810a-adefe3b7a895" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_da340fbe-46d9-4cb1-810a-adefe3b7a895_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_da340fbe-46d9-4cb1-810a-adefe3b7a895" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_da340fbe-46d9-4cb1-810a-adefe3b7a895_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_28b67b34-c2d9-4e64-bf71-2b23733cf746" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_da340fbe-46d9-4cb1-810a-adefe3b7a895" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_28b67b34-c2d9-4e64-bf71-2b23733cf746" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_6531a2ff-cc30-475d-b625-b2cd78b5adff" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_28b67b34-c2d9-4e64-bf71-2b23733cf746" xlink:to="loc_us-gaap_TrademarksMember_6531a2ff-cc30-475d-b625-b2cd78b5adff" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelationshipsMember_6a2ac253-00db-4eac-b822-76f9971f7a47" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CustomerRelationshipsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_28b67b34-c2d9-4e64-bf71-2b23733cf746" xlink:to="loc_us-gaap_CustomerRelationshipsMember_6a2ac253-00db-4eac-b822-76f9971f7a47" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_ed764a7a-4a9f-4b0b-8cc2-a93bc28bc4c3" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8e604d4e-6c39-4a48-9c3b-c8c5b906a0e3" xlink:to="loc_srt_RangeAxis_ed764a7a-4a9f-4b0b-8cc2-a93bc28bc4c3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_ed764a7a-4a9f-4b0b-8cc2-a93bc28bc4c3_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_ed764a7a-4a9f-4b0b-8cc2-a93bc28bc4c3" xlink:to="loc_srt_RangeMember_ed764a7a-4a9f-4b0b-8cc2-a93bc28bc4c3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_87634d93-d656-47ec-99a7-9d31014e4986" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_ed764a7a-4a9f-4b0b-8cc2-a93bc28bc4c3" xlink:to="loc_srt_RangeMember_87634d93-d656-47ec-99a7-9d31014e4986" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_e4071b5e-1c47-401b-86fe-c9daac26584d" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_87634d93-d656-47ec-99a7-9d31014e4986" xlink:to="loc_srt_MinimumMember_e4071b5e-1c47-401b-86fe-c9daac26584d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_007b17d4-1f78-4bff-82a0-6231d55a7ca4" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_87634d93-d656-47ec-99a7-9d31014e4986" xlink:to="loc_srt_MaximumMember_007b17d4-1f78-4bff-82a0-6231d55a7ca4" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESLILYSSWEETSLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#BUSINESSACQUISITIONANDDIVESTITURESLILYSSWEETSLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESLILYSSWEETSLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="extended" id="ibb191646715c4649a8ad6a4a8ada9c90_BUSINESSACQUISITIONANDDIVESTITURESLILYSSWEETSLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_f845c728-62c8-484c-bc3e-ccb67c973a93" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_64d91b01-4a86-4c22-9ec5-5eb1a2637f85" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f845c728-62c8-484c-bc3e-ccb67c973a93" xlink:to="loc_us-gaap_Goodwill_64d91b01-4a86-4c22-9ec5-5eb1a2637f85" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_519f808b-269d-4d96-b6ed-636728980cc4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f845c728-62c8-484c-bc3e-ccb67c973a93" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_519f808b-269d-4d96-b6ed-636728980cc4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssetsOther_c656738d-0847-4ee9-ad6d-cd061afb0bed" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssetsOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f845c728-62c8-484c-bc3e-ccb67c973a93" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssetsOther_c656738d-0847-4ee9-ad6d-cd061afb0bed" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther_7d561400-7678-4134-85f2-731c71bfe805" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f845c728-62c8-484c-bc3e-ccb67c973a93" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther_7d561400-7678-4134-85f2-731c71bfe805" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxLiabilities_b79757a8-474e-4282-ab54-d98548b76a5c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f845c728-62c8-484c-bc3e-ccb67c973a93" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxLiabilities_b79757a8-474e-4282-ab54-d98548b76a5c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_9cdb39f4-0eee-4460-87a4-88ea2f85e1c8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f845c728-62c8-484c-bc3e-ccb67c973a93" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_9cdb39f4-0eee-4460-87a4-88ea2f85e1c8" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_08a56833-1fd7-4ff0-966d-3c7266a7de60" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f845c728-62c8-484c-bc3e-ccb67c973a93" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_08a56833-1fd7-4ff0-966d-3c7266a7de60" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_a7725b53-2a42-4e5c-b9c3-8a2fdc73bfcf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_08a56833-1fd7-4ff0-966d-3c7266a7de60" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_a7725b53-2a42-4e5c-b9c3-8a2fdc73bfcf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_a7725b53-2a42-4e5c-b9c3-8a2fdc73bfcf_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_a7725b53-2a42-4e5c-b9c3-8a2fdc73bfcf" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_a7725b53-2a42-4e5c-b9c3-8a2fdc73bfcf_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_8ffc917f-f9c7-446b-86ef-da6b15ab19a3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_a7725b53-2a42-4e5c-b9c3-8a2fdc73bfcf" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_8ffc917f-f9c7-446b-86ef-da6b15ab19a3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LilysSweetsLLCMember_733f7081-ab17-4846-a23d-1b6e81e025f2" xlink:href="hsy-20221002.xsd#hsy_LilysSweetsLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_8ffc917f-f9c7-446b-86ef-da6b15ab19a3" xlink:to="loc_hsy_LilysSweetsLLCMember_733f7081-ab17-4846-a23d-1b6e81e025f2" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails" xlink:type="extended" id="i56f7bb28074340bfa48639bbbe3adbca_GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillLineItems_3bf0333a-0e3c-4633-818c-877917455ab1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GoodwillLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillRollForward_8799e34c-f5fc-4d76-93bb-9bd6cbbcd64c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GoodwillRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillLineItems_3bf0333a-0e3c-4633-818c-877917455ab1" xlink:to="loc_us-gaap_GoodwillRollForward_8799e34c-f5fc-4d76-93bb-9bd6cbbcd64c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_8918bb41-8b41-41ca-b764-2264a81845c1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillRollForward_8799e34c-f5fc-4d76-93bb-9bd6cbbcd64c" xlink:to="loc_us-gaap_Goodwill_8918bb41-8b41-41ca-b764-2264a81845c1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_b6427f0d-4661-4df4-bc26-f5d979651f85" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GoodwillPurchaseAccountingAdjustments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillRollForward_8799e34c-f5fc-4d76-93bb-9bd6cbbcd64c" xlink:to="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_b6427f0d-4661-4df4-bc26-f5d979651f85" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillForeignCurrencyTranslationGainLoss_6ea5632b-019f-4f87-8ba8-781376992d00" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GoodwillForeignCurrencyTranslationGainLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillRollForward_8799e34c-f5fc-4d76-93bb-9bd6cbbcd64c" xlink:to="loc_us-gaap_GoodwillForeignCurrencyTranslationGainLoss_6ea5632b-019f-4f87-8ba8-781376992d00" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_6dc9905e-2aa2-479c-9f57-317cae39ea00" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Goodwill"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfGoodwillTable_d11dbf26-6feb-469f-a786-01cb67b7330a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfGoodwillTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_GoodwillLineItems_3bf0333a-0e3c-4633-818c-877917455ab1" xlink:to="loc_us-gaap_ScheduleOfGoodwillTable_d11dbf26-6feb-469f-a786-01cb67b7330a" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_33494eb7-04e0-41e4-84fc-06e04a941272" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfGoodwillTable_d11dbf26-6feb-469f-a786-01cb67b7330a" xlink:to="loc_srt_ConsolidationItemsAxis_33494eb7-04e0-41e4-84fc-06e04a941272" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_33494eb7-04e0-41e4-84fc-06e04a941272_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_33494eb7-04e0-41e4-84fc-06e04a941272" xlink:to="loc_srt_ConsolidationItemsDomain_33494eb7-04e0-41e4-84fc-06e04a941272_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_9aa9b12e-8084-471e-8bb1-a193e7d6aefd" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_33494eb7-04e0-41e4-84fc-06e04a941272" xlink:to="loc_srt_ConsolidationItemsDomain_9aa9b12e-8084-471e-8bb1-a193e7d6aefd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_3ebff141-b2c6-4186-8b16-8a8ca24ec03f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_9aa9b12e-8084-471e-8bb1-a193e7d6aefd" xlink:to="loc_us-gaap_OperatingSegmentsMember_3ebff141-b2c6-4186-8b16-8a8ca24ec03f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_541a0a56-ff04-4e69-8b9c-068c4f476a9e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfGoodwillTable_d11dbf26-6feb-469f-a786-01cb67b7330a" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_541a0a56-ff04-4e69-8b9c-068c4f476a9e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_541a0a56-ff04-4e69-8b9c-068c4f476a9e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_541a0a56-ff04-4e69-8b9c-068c4f476a9e" xlink:to="loc_us-gaap_SegmentDomain_541a0a56-ff04-4e69-8b9c-068c4f476a9e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_6c9eaaf0-fef2-4794-850a-c18a67142961" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_541a0a56-ff04-4e69-8b9c-068c4f476a9e" xlink:to="loc_us-gaap_SegmentDomain_6c9eaaf0-fef2-4794-850a-c18a67142961" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaConfectionerySegmentMember_edbb969f-8a36-40fb-8f6e-52652769b616" xlink:href="hsy-20221002.xsd#hsy_NorthAmericaConfectionerySegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_6c9eaaf0-fef2-4794-850a-c18a67142961" xlink:to="loc_hsy_NorthAmericaConfectionerySegmentMember_edbb969f-8a36-40fb-8f6e-52652769b616" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaSaltySnacksSegmentMember_dc13d46a-85a0-49a8-ac6f-0a17d6a18c19" xlink:href="hsy-20221002.xsd#hsy_NorthAmericaSaltySnacksSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_6c9eaaf0-fef2-4794-850a-c18a67142961" xlink:to="loc_hsy_NorthAmericaSaltySnacksSegmentMember_dc13d46a-85a0-49a8-ac6f-0a17d6a18c19" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalSegmentMember_15eed616-b20c-4797-ad08-473fa29cc6cb" xlink:href="hsy-20221002.xsd#hsy_InternationalSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_6c9eaaf0-fef2-4794-850a-c18a67142961" xlink:to="loc_hsy_InternationalSegmentMember_15eed616-b20c-4797-ad08-473fa29cc6cb" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails" xlink:type="extended" id="i49527169a268483f9ed916eb73e82613_GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_772624cf-81bd-4577-a05d-b5dc2d69b44e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsGross_e0998497-5324-46c1-b0ac-886fbebc4328" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_772624cf-81bd-4577-a05d-b5dc2d69b44e" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsGross_e0998497-5324-46c1-b0ac-886fbebc4328" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_8a7f3f99-fe29-4904-9578-6136d44d51f8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_772624cf-81bd-4577-a05d-b5dc2d69b44e" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_8a7f3f99-fe29-4904-9578-6136d44d51f8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_265724fb-82f2-452d-a545-a77e8d6d3eb8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_772624cf-81bd-4577-a05d-b5dc2d69b44e" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_265724fb-82f2-452d-a545-a77e8d6d3eb8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_7ba0cf29-b2bf-47fc-8ca0-1336af1b39d2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IntangibleAssetsNetExcludingGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_772624cf-81bd-4577-a05d-b5dc2d69b44e" xlink:to="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_7ba0cf29-b2bf-47fc-8ca0-1336af1b39d2" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_2584b329-a22f-42b2-9d06-510efca289d1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_772624cf-81bd-4577-a05d-b5dc2d69b44e" xlink:to="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_2584b329-a22f-42b2-9d06-510efca289d1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_6c6ed98b-7d7f-4f44-a654-f995629ba425" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_2584b329-a22f-42b2-9d06-510efca289d1" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_6c6ed98b-7d7f-4f44-a654-f995629ba425" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_6c6ed98b-7d7f-4f44-a654-f995629ba425_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_6c6ed98b-7d7f-4f44-a654-f995629ba425" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_6c6ed98b-7d7f-4f44-a654-f995629ba425_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_1c10c5de-9add-4b28-b697-bc6e5c0898dd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_6c6ed98b-7d7f-4f44-a654-f995629ba425" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_1c10c5de-9add-4b28-b697-bc6e5c0898dd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_bb920eca-8427-46d6-933f-9a8d5a347db9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_1c10c5de-9add-4b28-b697-bc6e5c0898dd" xlink:to="loc_us-gaap_TrademarksMember_bb920eca-8427-46d6-933f-9a8d5a347db9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelatedIntangibleAssetsMember_4c6b8914-1cdc-4298-a17d-c6b8d737dcb9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CustomerRelatedIntangibleAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_1c10c5de-9add-4b28-b697-bc6e5c0898dd" xlink:to="loc_us-gaap_CustomerRelatedIntangibleAssetsMember_4c6b8914-1cdc-4298-a17d-c6b8d737dcb9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PatentsMember_8fd95d83-682a-4914-a66a-334a7184c6fd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PatentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_1c10c5de-9add-4b28-b697-bc6e5c0898dd" xlink:to="loc_us-gaap_PatentsMember_8fd95d83-682a-4914-a66a-334a7184c6fd" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_446a8595-9a63-427b-9305-b85be50d63fe" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_2584b329-a22f-42b2-9d06-510efca289d1" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_446a8595-9a63-427b-9305-b85be50d63fe" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_446a8595-9a63-427b-9305-b85be50d63fe_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_446a8595-9a63-427b-9305-b85be50d63fe" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_446a8595-9a63-427b-9305-b85be50d63fe_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_ccdae21c-3463-4eb3-81e1-2637fbcf54c3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_446a8595-9a63-427b-9305-b85be50d63fe" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_ccdae21c-3463-4eb3-81e1-2637fbcf54c3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_a1120eec-e972-4232-85c8-f4bc0e82d837" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_ccdae21c-3463-4eb3-81e1-2637fbcf54c3" xlink:to="loc_us-gaap_TrademarksMember_a1120eec-e972-4232-85c8-f4bc0e82d837" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails" xlink:type="extended" id="i801c4eaf68314321a203ffafb6a338c6_SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityLineItems_ba9f8390-0e79-489d-8766-abfe995dd22d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LineOfCreditFacilityLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_fe202352-dc64-486b-b87c-429c978c6f10" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_ba9f8390-0e79-489d-8766-abfe995dd22d" xlink:to="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_fe202352-dc64-486b-b87c-429c978c6f10" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LineOfCreditFacilityAccordionFeatureIncreaseLimit_195fd4bd-8907-4090-b257-56860f0083af" xlink:href="hsy-20221002.xsd#hsy_LineOfCreditFacilityAccordionFeatureIncreaseLimit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_ba9f8390-0e79-489d-8766-abfe995dd22d" xlink:to="loc_hsy_LineOfCreditFacilityAccordionFeatureIncreaseLimit_195fd4bd-8907-4090-b257-56860f0083af" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DebtTerminationDateExtensionTerm_e551088e-b5e7-4d1b-81a5-7226f5b3f972" xlink:href="hsy-20221002.xsd#hsy_DebtTerminationDateExtensionTerm"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_ba9f8390-0e79-489d-8766-abfe995dd22d" xlink:to="loc_hsy_DebtTerminationDateExtensionTerm_e551088e-b5e7-4d1b-81a5-7226f5b3f972" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DebtTerminationDateNumberOfExtensionOption_d3f5fb7f-243d-4d3d-8def-274a4c71d6a0" xlink:href="hsy-20221002.xsd#hsy_DebtTerminationDateNumberOfExtensionOption"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_ba9f8390-0e79-489d-8766-abfe995dd22d" xlink:to="loc_hsy_DebtTerminationDateNumberOfExtensionOption_d3f5fb7f-243d-4d3d-8def-274a4c71d6a0" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LinesOfCreditCurrent_3bd43106-5a25-43ff-a24a-015f7218602f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LinesOfCreditCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_ba9f8390-0e79-489d-8766-abfe995dd22d" xlink:to="loc_us-gaap_LinesOfCreditCurrent_3bd43106-5a25-43ff-a24a-015f7218602f" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermBorrowings_a1a9bce2-5400-43c5-8761-08d44892f3c3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShortTermBorrowings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_ba9f8390-0e79-489d-8766-abfe995dd22d" xlink:to="loc_us-gaap_ShortTermBorrowings_a1a9bce2-5400-43c5-8761-08d44892f3c3" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtWeightedAverageInterestRate_67fc65df-1417-4c7d-ac82-063158a133f3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShortTermDebtWeightedAverageInterestRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_ba9f8390-0e79-489d-8766-abfe995dd22d" xlink:to="loc_us-gaap_ShortTermDebtWeightedAverageInterestRate_67fc65df-1417-4c7d-ac82-063158a133f3" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityTable_dcbb3484-76c3-4aef-b1c3-35151f0c1163" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LineOfCreditFacilityTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_ba9f8390-0e79-489d-8766-abfe995dd22d" xlink:to="loc_us-gaap_LineOfCreditFacilityTable_dcbb3484-76c3-4aef-b1c3-35151f0c1163" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_68809e7f-aba8-47ae-8fe0-9d77369fba13" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_dcbb3484-76c3-4aef-b1c3-35151f0c1163" xlink:to="loc_us-gaap_DebtInstrumentAxis_68809e7f-aba8-47ae-8fe0-9d77369fba13" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_68809e7f-aba8-47ae-8fe0-9d77369fba13_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_68809e7f-aba8-47ae-8fe0-9d77369fba13" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_68809e7f-aba8-47ae-8fe0-9d77369fba13_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_60ca2d0a-3b33-47f5-b22c-9536019aee39" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_68809e7f-aba8-47ae-8fe0-9d77369fba13" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_60ca2d0a-3b33-47f5-b22c-9536019aee39" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditMember_fa757bff-2bcb-4403-857e-880d786e52de" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_60ca2d0a-3b33-47f5-b22c-9536019aee39" xlink:to="loc_us-gaap_LineOfCreditMember_fa757bff-2bcb-4403-857e-880d786e52de" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityAxis_967db1a9-17da-49d3-8f7a-3d1047a77dd0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_dcbb3484-76c3-4aef-b1c3-35151f0c1163" xlink:to="loc_us-gaap_CreditFacilityAxis_967db1a9-17da-49d3-8f7a-3d1047a77dd0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_967db1a9-17da-49d3-8f7a-3d1047a77dd0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_967db1a9-17da-49d3-8f7a-3d1047a77dd0" xlink:to="loc_us-gaap_CreditFacilityDomain_967db1a9-17da-49d3-8f7a-3d1047a77dd0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_1181d65e-3a7c-4711-9a26-67113e73d6b8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_967db1a9-17da-49d3-8f7a-3d1047a77dd0" xlink:to="loc_us-gaap_CreditFacilityDomain_1181d65e-3a7c-4711-9a26-67113e73d6b8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevolvingCreditFacilityMember_5cb7801b-8b34-46e5-ac2f-c1b4663511e7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RevolvingCreditFacilityMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_1181d65e-3a7c-4711-9a26-67113e73d6b8" xlink:to="loc_us-gaap_RevolvingCreditFacilityMember_5cb7801b-8b34-46e5-ac2f-c1b4663511e7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_c89fcf4a-655f-4bce-b95d-7bc1ced4657d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_dcbb3484-76c3-4aef-b1c3-35151f0c1163" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_c89fcf4a-655f-4bce-b95d-7bc1ced4657d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_c89fcf4a-655f-4bce-b95d-7bc1ced4657d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_c89fcf4a-655f-4bce-b95d-7bc1ced4657d" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_c89fcf4a-655f-4bce-b95d-7bc1ced4657d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_8d6ab306-097e-454b-9b06-f7381a657134" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_c89fcf4a-655f-4bce-b95d-7bc1ced4657d" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_8d6ab306-097e-454b-9b06-f7381a657134" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditMember_d4752956-6094-4dbe-b51d-50b880190a65" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_8d6ab306-097e-454b-9b06-f7381a657134" xlink:to="loc_us-gaap_LineOfCreditMember_d4752956-6094-4dbe-b51d-50b880190a65" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignLineOfCreditMember_696cefde-5aa7-47f1-8d70-d88685b0c57f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ForeignLineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_8d6ab306-097e-454b-9b06-f7381a657134" xlink:to="loc_us-gaap_ForeignLineOfCreditMember_696cefde-5aa7-47f1-8d70-d88685b0c57f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeAxis_188549e8-297f-4538-8196-d4593888a17b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShortTermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_dcbb3484-76c3-4aef-b1c3-35151f0c1163" xlink:to="loc_us-gaap_ShortTermDebtTypeAxis_188549e8-297f-4538-8196-d4593888a17b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeDomain_188549e8-297f-4538-8196-d4593888a17b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShortTermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShortTermDebtTypeAxis_188549e8-297f-4538-8196-d4593888a17b" xlink:to="loc_us-gaap_ShortTermDebtTypeDomain_188549e8-297f-4538-8196-d4593888a17b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeDomain_1a6d4599-91d4-489b-8b53-dce9a6703bcd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShortTermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShortTermDebtTypeAxis_188549e8-297f-4538-8196-d4593888a17b" xlink:to="loc_us-gaap_ShortTermDebtTypeDomain_1a6d4599-91d4-489b-8b53-dce9a6703bcd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPaperMember_241f31e6-1bf0-41e3-8ac7-a6efe8ba79b0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommercialPaperMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortTermDebtTypeDomain_1a6d4599-91d4-489b-8b53-dce9a6703bcd" xlink:to="loc_us-gaap_CommercialPaperMember_241f31e6-1bf0-41e3-8ac7-a6efe8ba79b0" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails" xlink:type="extended" id="i35710a339b464ff2a82cc85c9f1ab93e_SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentLineItems_fbcbaae4-f17a-428b-a22f-f9a559e73b0e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiability_bdf64803-c100-4d45-bd8b-993c4f585f86" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FinanceLeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_fbcbaae4-f17a-428b-a22f-f9a559e73b0e" xlink:to="loc_us-gaap_FinanceLeaseLiability_bdf64803-c100-4d45-bd8b-993c4f585f86" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DebtInstrumentImpactofDerivativesUnamortizedDiscountPremiumandDebtIssuanceCostsNet_a62952ae-9dfc-41b5-b54c-9aece573930d" xlink:href="hsy-20221002.xsd#hsy_DebtInstrumentImpactofDerivativesUnamortizedDiscountPremiumandDebtIssuanceCostsNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_fbcbaae4-f17a-428b-a22f-f9a559e73b0e" xlink:to="loc_hsy_DebtInstrumentImpactofDerivativesUnamortizedDiscountPremiumandDebtIssuanceCostsNet_a62952ae-9dfc-41b5-b54c-9aece573930d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebt_3662d32d-b97c-41de-a034-561f626439fe" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebt"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_fbcbaae4-f17a-428b-a22f-f9a559e73b0e" xlink:to="loc_us-gaap_LongTermDebt_3662d32d-b97c-41de-a034-561f626439fe" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtCurrent_25bd4910-e643-4042-ad34-c0f6c5aa07f7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebtCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_fbcbaae4-f17a-428b-a22f-f9a559e73b0e" xlink:to="loc_us-gaap_LongTermDebtCurrent_25bd4910-e643-4042-ad34-c0f6c5aa07f7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtNoncurrent_f901db36-5fd5-446f-9c47-bb15682e4773" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebtNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_fbcbaae4-f17a-428b-a22f-f9a559e73b0e" xlink:to="loc_us-gaap_LongTermDebtNoncurrent_f901db36-5fd5-446f-9c47-bb15682e4773" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentTable_3f9a05a4-b5f7-4f0b-9960-9879efd11207" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtInstrumentLineItems_fbcbaae4-f17a-428b-a22f-f9a559e73b0e" xlink:to="loc_us-gaap_DebtInstrumentTable_3f9a05a4-b5f7-4f0b-9960-9879efd11207" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_6097035e-db7f-405b-9711-86e49e95b822" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_3f9a05a4-b5f7-4f0b-9960-9879efd11207" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_6097035e-db7f-405b-9711-86e49e95b822" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_6097035e-db7f-405b-9711-86e49e95b822_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_6097035e-db7f-405b-9711-86e49e95b822" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_6097035e-db7f-405b-9711-86e49e95b822_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_f4aeb1aa-173d-4363-b102-4429a9e098f6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_6097035e-db7f-405b-9711-86e49e95b822" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_f4aeb1aa-173d-4363-b102-4429a9e098f6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DomesticCorporateDebtSecuritiesMember_1b4e846b-9b33-4e5e-a7f4-da922db2208b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DomesticCorporateDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_f4aeb1aa-173d-4363-b102-4429a9e098f6" xlink:to="loc_us-gaap_DomesticCorporateDebtSecuritiesMember_1b4e846b-9b33-4e5e-a7f4-da922db2208b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_2fd45516-b9bc-4518-8e54-9d3013eed4b6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_3f9a05a4-b5f7-4f0b-9960-9879efd11207" xlink:to="loc_us-gaap_DebtInstrumentAxis_2fd45516-b9bc-4518-8e54-9d3013eed4b6" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_2fd45516-b9bc-4518-8e54-9d3013eed4b6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_2fd45516-b9bc-4518-8e54-9d3013eed4b6" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_2fd45516-b9bc-4518-8e54-9d3013eed4b6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_2fd45516-b9bc-4518-8e54-9d3013eed4b6" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.625Due2023Member_838f2a84-24a7-4b6e-8476-be5e7a0f86da" xlink:href="hsy-20221002.xsd#hsy_Notes2.625Due2023Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes2.625Due2023Member_838f2a84-24a7-4b6e-8476-be5e7a0f86da" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3375Due2023Member_ebe72980-e3b5-43e1-bc58-b13ccdac1c16" xlink:href="hsy-20221002.xsd#hsy_Notes3375Due2023Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes3375Due2023Member_ebe72980-e3b5-43e1-bc58-b13ccdac1c16" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.050Due2024Member_ec40eabe-d97f-4734-9f33-350304314862" xlink:href="hsy-20221002.xsd#hsy_Notes2.050Due2024Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes2.050Due2024Member_ec40eabe-d97f-4734-9f33-350304314862" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes0900NotesDue2025Member_6b657c9b-d618-4e52-bbec-8d1ab4293c14" xlink:href="hsy-20221002.xsd#hsy_Notes0900NotesDue2025Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes0900NotesDue2025Member_6b657c9b-d618-4e52-bbec-8d1ab4293c14" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.20Due2025Member_59830b33-6776-4e1b-a1f2-d3e93af71a58" xlink:href="hsy-20221002.xsd#hsy_Notes3.20Due2025Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes3.20Due2025Member_59830b33-6776-4e1b-a1f2-d3e93af71a58" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.30Due2026Member_091e4f3f-7c91-4bf1-b96f-dcfe1ea48e05" xlink:href="hsy-20221002.xsd#hsy_Notes2.30Due2026Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes2.30Due2026Member_091e4f3f-7c91-4bf1-b96f-dcfe1ea48e05" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Debentures7.2Due2027Member_0f4e9557-83b2-4450-a142-8b53f0345014" xlink:href="hsy-20221002.xsd#hsy_Debentures7.2Due2027Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Debentures7.2Due2027Member_0f4e9557-83b2-4450-a142-8b53f0345014" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.450Due2029Member_a6378838-7a2b-488b-9043-e3b7066dcbd2" xlink:href="hsy-20221002.xsd#hsy_Notes2.450Due2029Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes2.450Due2029Member_a6378838-7a2b-488b-9043-e3b7066dcbd2" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes1700Due2030Member_d6d5f35d-1486-42d1-b0ae-55edf6bb17e9" xlink:href="hsy-20221002.xsd#hsy_Notes1700Due2030Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes1700Due2030Member_d6d5f35d-1486-42d1-b0ae-55edf6bb17e9" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.375Due2046Member_87fe460a-29a7-4eb3-aff9-e0d962fe82a8" xlink:href="hsy-20221002.xsd#hsy_Notes3.375Due2046Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes3.375Due2046Member_87fe460a-29a7-4eb3-aff9-e0d962fe82a8" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.125Due2049Member_1ed517de-03a7-4f15-aafe-50158096b370" xlink:href="hsy-20221002.xsd#hsy_Notes3.125Due2049Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes3.125Due2049Member_1ed517de-03a7-4f15-aafe-50158096b370" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2650NotesDue2050Member_ab75cc03-e730-4424-aad7-dbd59d6b7ef1" xlink:href="hsy-20221002.xsd#hsy_Notes2650NotesDue2050Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_08b9de2f-4218-4088-b767-6b1ddd279794" xlink:to="loc_hsy_Notes2650NotesDue2050Member_ab75cc03-e730-4424-aad7-dbd59d6b7ef1" xlink:type="arc" order="11"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTLONGTERMDEBTINTERESTRATESDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#SHORTANDLONGTERMDEBTLONGTERMDEBTINTERESTRATESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTLONGTERMDEBTINTERESTRATESDetails" xlink:type="extended" id="i50bddf28489e42889e581a5c08b976f0_SHORTANDLONGTERMDEBTLONGTERMDEBTINTERESTRATESDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentLineItems_9c457fa2-0e4a-4ed2-b340-892c6fd8b34c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentInterestRateStatedPercentage_115e5429-da73-4aff-8bf2-606031c7685c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentInterestRateStatedPercentage"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_9c457fa2-0e4a-4ed2-b340-892c6fd8b34c" xlink:to="loc_us-gaap_DebtInstrumentInterestRateStatedPercentage_115e5429-da73-4aff-8bf2-606031c7685c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentTable_e09d382e-6206-4112-807b-c3ca51d2d050" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtInstrumentLineItems_9c457fa2-0e4a-4ed2-b340-892c6fd8b34c" xlink:to="loc_us-gaap_DebtInstrumentTable_e09d382e-6206-4112-807b-c3ca51d2d050" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_1d830009-53bf-4f6d-b038-401e2843a1fc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_e09d382e-6206-4112-807b-c3ca51d2d050" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_1d830009-53bf-4f6d-b038-401e2843a1fc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_1d830009-53bf-4f6d-b038-401e2843a1fc_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_1d830009-53bf-4f6d-b038-401e2843a1fc" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_1d830009-53bf-4f6d-b038-401e2843a1fc_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_34634033-2f8e-480a-8641-35f389aa8398" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_1d830009-53bf-4f6d-b038-401e2843a1fc" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_34634033-2f8e-480a-8641-35f389aa8398" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DomesticCorporateDebtSecuritiesMember_dcf1e0c8-49aa-4a52-be6b-6c05acdc06b5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DomesticCorporateDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_34634033-2f8e-480a-8641-35f389aa8398" xlink:to="loc_us-gaap_DomesticCorporateDebtSecuritiesMember_dcf1e0c8-49aa-4a52-be6b-6c05acdc06b5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_fded35cb-35d7-454e-8fc9-e4bc418d6df7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_e09d382e-6206-4112-807b-c3ca51d2d050" xlink:to="loc_us-gaap_DebtInstrumentAxis_fded35cb-35d7-454e-8fc9-e4bc418d6df7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_fded35cb-35d7-454e-8fc9-e4bc418d6df7_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_fded35cb-35d7-454e-8fc9-e4bc418d6df7" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_fded35cb-35d7-454e-8fc9-e4bc418d6df7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_fded35cb-35d7-454e-8fc9-e4bc418d6df7" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.625Due2023Member_5ba625e1-f613-45e1-9466-c51971f75fe9" xlink:href="hsy-20221002.xsd#hsy_Notes2.625Due2023Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes2.625Due2023Member_5ba625e1-f613-45e1-9466-c51971f75fe9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3375Due2023Member_fe387054-3739-4a82-bc95-259bf6429424" xlink:href="hsy-20221002.xsd#hsy_Notes3375Due2023Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes3375Due2023Member_fe387054-3739-4a82-bc95-259bf6429424" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.050Due2024Member_ea60a14e-6a6c-466e-a0af-b40f7907bc92" xlink:href="hsy-20221002.xsd#hsy_Notes2.050Due2024Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes2.050Due2024Member_ea60a14e-6a6c-466e-a0af-b40f7907bc92" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes0900NotesDue2025Member_f3e170c0-26d9-40b0-abf9-353be07eab26" xlink:href="hsy-20221002.xsd#hsy_Notes0900NotesDue2025Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes0900NotesDue2025Member_f3e170c0-26d9-40b0-abf9-353be07eab26" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.20Due2025Member_3a533a39-f575-4b3f-8a06-02bb84fb88f6" xlink:href="hsy-20221002.xsd#hsy_Notes3.20Due2025Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes3.20Due2025Member_3a533a39-f575-4b3f-8a06-02bb84fb88f6" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.30Due2026Member_955bd5a0-284e-47af-8df2-a56d6cf17f77" xlink:href="hsy-20221002.xsd#hsy_Notes2.30Due2026Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes2.30Due2026Member_955bd5a0-284e-47af-8df2-a56d6cf17f77" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Debentures7.2Due2027Member_3f6017c1-45d7-4c81-be89-0abf8662401c" xlink:href="hsy-20221002.xsd#hsy_Debentures7.2Due2027Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Debentures7.2Due2027Member_3f6017c1-45d7-4c81-be89-0abf8662401c" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.450Due2029Member_e81eec8c-09eb-440e-8e19-12b4ddb2a7e9" xlink:href="hsy-20221002.xsd#hsy_Notes2.450Due2029Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes2.450Due2029Member_e81eec8c-09eb-440e-8e19-12b4ddb2a7e9" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes1700Due2030Member_53149142-914a-42ce-abe5-cd9be62cd8dc" xlink:href="hsy-20221002.xsd#hsy_Notes1700Due2030Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes1700Due2030Member_53149142-914a-42ce-abe5-cd9be62cd8dc" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.375Due2046Member_8fb02227-b110-4fba-b987-a84b12079555" xlink:href="hsy-20221002.xsd#hsy_Notes3.375Due2046Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes3.375Due2046Member_8fb02227-b110-4fba-b987-a84b12079555" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.125Due2049Member_7746aa15-fdf5-421e-9df2-331369c9cf97" xlink:href="hsy-20221002.xsd#hsy_Notes3.125Due2049Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes3.125Due2049Member_7746aa15-fdf5-421e-9df2-331369c9cf97" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2650NotesDue2050Member_70f1f8ed-07ea-4a4c-8686-c6d95df94c1e" xlink:href="hsy-20221002.xsd#hsy_Notes2650NotesDue2050Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_46486eb9-b9c9-416a-b33b-c8a016bfb1bb" xlink:to="loc_hsy_Notes2650NotesDue2050Member_70f1f8ed-07ea-4a4c-8686-c6d95df94c1e" xlink:type="arc" order="11"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#DERIVATIVEINSTRUMENTSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSNARRATIVEDetails" xlink:type="extended" id="i615874051fe64e5c9762d018f39f92ec_DERIVATIVEINSTRUMENTSNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLineItems_53454341-8bd1-4e7e-85a9-4da4a16b985e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTermOfContract_52da1963-1990-4f3d-8fae-2b9c3367ec7a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeTermOfContract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_53454341-8bd1-4e7e-85a9-4da4a16b985e" xlink:to="loc_us-gaap_DerivativeTermOfContract_52da1963-1990-4f3d-8fae-2b9c3367ec7a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeNotionalAmount_ffaf4468-e355-4fd2-a338-2cee4f81fa73" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeNotionalAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_53454341-8bd1-4e7e-85a9-4da4a16b985e" xlink:to="loc_us-gaap_DerivativeNotionalAmount_ffaf4468-e355-4fd2-a338-2cee4f81fa73" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_MinimumLengthofTimeHedgedinCashFlowHedge_94a8df39-6fb8-4f7a-ad9b-da2926b7d031" xlink:href="hsy-20221002.xsd#hsy_MinimumLengthofTimeHedgedinCashFlowHedge"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_53454341-8bd1-4e7e-85a9-4da4a16b985e" xlink:to="loc_hsy_MinimumLengthofTimeHedgedinCashFlowHedge_94a8df39-6fb8-4f7a-ad9b-da2926b7d031" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MaximumLengthOfTimeHedgedInCashFlowHedge1_b41c605f-63eb-47fe-950d-2ebfd8bd313a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_MaximumLengthOfTimeHedgedInCashFlowHedge1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_53454341-8bd1-4e7e-85a9-4da4a16b985e" xlink:to="loc_us-gaap_MaximumLengthOfTimeHedgedInCashFlowHedge1_b41c605f-63eb-47fe-950d-2ebfd8bd313a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgeGainLossToBeReclassifiedWithinTwelveMonths_33ec1127-2d88-4904-a695-82bcc37bfc9f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashFlowHedgeGainLossToBeReclassifiedWithinTwelveMonths"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_53454341-8bd1-4e7e-85a9-4da4a16b985e" xlink:to="loc_us-gaap_CashFlowHedgeGainLossToBeReclassifiedWithinTwelveMonths_33ec1127-2d88-4904-a695-82bcc37bfc9f" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTable_b11b828d-ac7c-4122-9eba-13236bfd3810" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeLineItems_53454341-8bd1-4e7e-85a9-4da4a16b985e" xlink:to="loc_us-gaap_DerivativeTable_b11b828d-ac7c-4122-9eba-13236bfd3810" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_abb11eee-00f7-4e2d-9067-2ae7ae8a6973" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_b11b828d-ac7c-4122-9eba-13236bfd3810" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_abb11eee-00f7-4e2d-9067-2ae7ae8a6973" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_abb11eee-00f7-4e2d-9067-2ae7ae8a6973_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_abb11eee-00f7-4e2d-9067-2ae7ae8a6973" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_abb11eee-00f7-4e2d-9067-2ae7ae8a6973_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_01d9109a-0458-4bc1-84fb-2d02b5bb55c1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_abb11eee-00f7-4e2d-9067-2ae7ae8a6973" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_01d9109a-0458-4bc1-84fb-2d02b5bb55c1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_4bc722cb-8324-442a-8dae-9361f117077c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_01d9109a-0458-4bc1-84fb-2d02b5bb55c1" xlink:to="loc_us-gaap_CommodityContractMember_4bc722cb-8324-442a-8dae-9361f117077c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_b4581938-9035-4859-ad84-bffdf71b96ea" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_01d9109a-0458-4bc1-84fb-2d02b5bb55c1" xlink:to="loc_us-gaap_ForeignExchangeContractMember_b4581938-9035-4859-ad84-bffdf71b96ea" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_9c014c9f-5618-43a0-b325-55dfa5b879f8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_01d9109a-0458-4bc1-84fb-2d02b5bb55c1" xlink:to="loc_us-gaap_EquitySwapMember_9c014c9f-5618-43a0-b325-55dfa5b879f8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_6e2789df-dc79-4332-a101-bfafffccb7fd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_b11b828d-ac7c-4122-9eba-13236bfd3810" xlink:to="loc_us-gaap_HedgingDesignationAxis_6e2789df-dc79-4332-a101-bfafffccb7fd" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_6e2789df-dc79-4332-a101-bfafffccb7fd_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_6e2789df-dc79-4332-a101-bfafffccb7fd" xlink:to="loc_us-gaap_HedgingDesignationDomain_6e2789df-dc79-4332-a101-bfafffccb7fd_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_0be20b65-c28b-4a8d-80fe-296e049d984f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_6e2789df-dc79-4332-a101-bfafffccb7fd" xlink:to="loc_us-gaap_HedgingDesignationDomain_0be20b65-c28b-4a8d-80fe-296e049d984f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_c23bb142-366e-447b-b6aa-3c1a2202ce9b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_0be20b65-c28b-4a8d-80fe-296e049d984f" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_c23bb142-366e-447b-b6aa-3c1a2202ce9b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_d18b8a3a-7a06-4c78-87b5-6ca457673d3e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_0be20b65-c28b-4a8d-80fe-296e049d984f" xlink:to="loc_us-gaap_NondesignatedMember_d18b8a3a-7a06-4c78-87b5-6ca457673d3e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_ebb2842e-f182-4949-84b1-25da19d4f408" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_b11b828d-ac7c-4122-9eba-13236bfd3810" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_ebb2842e-f182-4949-84b1-25da19d4f408" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_ebb2842e-f182-4949-84b1-25da19d4f408_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_ebb2842e-f182-4949-84b1-25da19d4f408" xlink:to="loc_us-gaap_HedgingRelationshipDomain_ebb2842e-f182-4949-84b1-25da19d4f408_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_ad35f894-af7f-4e59-8f11-8b6dba0b7b20" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_ebb2842e-f182-4949-84b1-25da19d4f408" xlink:to="loc_us-gaap_HedgingRelationshipDomain_ad35f894-af7f-4e59-8f11-8b6dba0b7b20" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgingMember_39bc03b9-58b6-409c-9923-352c2a591f73" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashFlowHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_ad35f894-af7f-4e59-8f11-8b6dba0b7b20" xlink:to="loc_us-gaap_CashFlowHedgingMember_39bc03b9-58b6-409c-9923-352c2a591f73" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_3ab1caf2-ff60-4202-858b-3a735193f97b" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_b11b828d-ac7c-4122-9eba-13236bfd3810" xlink:to="loc_srt_RangeAxis_3ab1caf2-ff60-4202-858b-3a735193f97b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_3ab1caf2-ff60-4202-858b-3a735193f97b_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_3ab1caf2-ff60-4202-858b-3a735193f97b" xlink:to="loc_srt_RangeMember_3ab1caf2-ff60-4202-858b-3a735193f97b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_4b43d886-9975-4625-a1e8-bf3e7272c794" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_3ab1caf2-ff60-4202-858b-3a735193f97b" xlink:to="loc_srt_RangeMember_4b43d886-9975-4625-a1e8-bf3e7272c794" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_48a6602e-c328-47cc-b947-28cf259d43c9" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_4b43d886-9975-4625-a1e8-bf3e7272c794" xlink:to="loc_srt_MinimumMember_48a6602e-c328-47cc-b947-28cf259d43c9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_3ccac187-ee0b-4504-9c72-7c44357850c2" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_4b43d886-9975-4625-a1e8-bf3e7272c794" xlink:to="loc_srt_MaximumMember_3ccac187-ee0b-4504-9c72-7c44357850c2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationAxis_ad59eab4-13b6-4de9-9766-552670af23af" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_b11b828d-ac7c-4122-9eba-13236bfd3810" xlink:to="loc_us-gaap_IncomeStatementLocationAxis_ad59eab4-13b6-4de9-9766-552670af23af" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_ad59eab4-13b6-4de9-9766-552670af23af_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_ad59eab4-13b6-4de9-9766-552670af23af" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_ad59eab4-13b6-4de9-9766-552670af23af_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_78e76911-fb3f-4109-bab7-494ee63be236" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_ad59eab4-13b6-4de9-9766-552670af23af" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_78e76911-fb3f-4109-bab7-494ee63be236" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails" xlink:type="extended" id="i36ed0d465e194bc5bffb27c228508524_DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesFairValueLineItems_584ef0a5-7197-4947-b432-297e35965dda" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativesFairValueLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_eb0d7cc2-326f-446e-b30d-0a99101aefa4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_584ef0a5-7197-4947-b432-297e35965dda" xlink:to="loc_us-gaap_DerivativeAssets_eb0d7cc2-326f-446e-b30d-0a99101aefa4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_30904182-d7ed-4937-8cbe-4e217f026b09" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_584ef0a5-7197-4947-b432-297e35965dda" xlink:to="loc_us-gaap_DerivativeLiabilities_30904182-d7ed-4937-8cbe-4e217f026b09" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DerivativeAssetCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_f9966804-f31d-45fc-a762-c34c9a88b61f" xlink:href="hsy-20221002.xsd#hsy_DerivativeAssetCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_584ef0a5-7197-4947-b432-297e35965dda" xlink:to="loc_hsy_DerivativeAssetCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_f9966804-f31d-45fc-a762-c34c9a88b61f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DerivativeLiabilityCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_a125561d-e136-48b3-968c-305e90687243" xlink:href="hsy-20221002.xsd#hsy_DerivativeLiabilityCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_584ef0a5-7197-4947-b432-297e35965dda" xlink:to="loc_hsy_DerivativeLiabilityCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_a125561d-e136-48b3-968c-305e90687243" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_e660d8cc-b3ab-441f-82d6-78ecf1219f2c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_584ef0a5-7197-4947-b432-297e35965dda" xlink:to="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_e660d8cc-b3ab-441f-82d6-78ecf1219f2c" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_8865028d-be81-40b4-a269-d8ebb47837f4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_e660d8cc-b3ab-441f-82d6-78ecf1219f2c" xlink:to="loc_us-gaap_HedgingDesignationAxis_8865028d-be81-40b4-a269-d8ebb47837f4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_8865028d-be81-40b4-a269-d8ebb47837f4_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_8865028d-be81-40b4-a269-d8ebb47837f4" xlink:to="loc_us-gaap_HedgingDesignationDomain_8865028d-be81-40b4-a269-d8ebb47837f4_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_165bf4d6-43aa-47a7-831f-0fca2c84e395" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_8865028d-be81-40b4-a269-d8ebb47837f4" xlink:to="loc_us-gaap_HedgingDesignationDomain_165bf4d6-43aa-47a7-831f-0fca2c84e395" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_ec5bc247-78d0-43cd-8799-cbf87d6c568c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_165bf4d6-43aa-47a7-831f-0fca2c84e395" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_ec5bc247-78d0-43cd-8799-cbf87d6c568c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_3be69277-c5a0-47e2-94a5-925bca8b4521" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_165bf4d6-43aa-47a7-831f-0fca2c84e395" xlink:to="loc_us-gaap_NondesignatedMember_3be69277-c5a0-47e2-94a5-925bca8b4521" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_9ee269b7-62c9-4453-bda4-ab08a642d292" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_e660d8cc-b3ab-441f-82d6-78ecf1219f2c" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_9ee269b7-62c9-4453-bda4-ab08a642d292" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_9ee269b7-62c9-4453-bda4-ab08a642d292_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_9ee269b7-62c9-4453-bda4-ab08a642d292" xlink:to="loc_us-gaap_HedgingRelationshipDomain_9ee269b7-62c9-4453-bda4-ab08a642d292_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_7633fb51-817e-4749-93f1-ae58be14a4d7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_9ee269b7-62c9-4453-bda4-ab08a642d292" xlink:to="loc_us-gaap_HedgingRelationshipDomain_7633fb51-817e-4749-93f1-ae58be14a4d7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgingMember_3b0e4f27-f535-4d19-94cd-5e86c13201d2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashFlowHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_7633fb51-817e-4749-93f1-ae58be14a4d7" xlink:to="loc_us-gaap_CashFlowHedgingMember_3b0e4f27-f535-4d19-94cd-5e86c13201d2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_9564cf8f-0608-4bbd-afe8-fbae74cbd395" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_e660d8cc-b3ab-441f-82d6-78ecf1219f2c" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_9564cf8f-0608-4bbd-afe8-fbae74cbd395" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_9564cf8f-0608-4bbd-afe8-fbae74cbd395_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_9564cf8f-0608-4bbd-afe8-fbae74cbd395" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_9564cf8f-0608-4bbd-afe8-fbae74cbd395_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_75720d8a-8cb5-4c4b-8562-8bfcd388b616" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_9564cf8f-0608-4bbd-afe8-fbae74cbd395" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_75720d8a-8cb5-4c4b-8562-8bfcd388b616" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_cb0c540e-506a-4ad2-a0ae-e3caa82726b9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_75720d8a-8cb5-4c4b-8562-8bfcd388b616" xlink:to="loc_us-gaap_ForeignExchangeContractMember_cb0c540e-506a-4ad2-a0ae-e3caa82726b9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_de71b000-c727-4879-890e-2ac61442ae93" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_75720d8a-8cb5-4c4b-8562-8bfcd388b616" xlink:to="loc_us-gaap_CommodityContractMember_de71b000-c727-4879-890e-2ac61442ae93" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_43b21de4-9fdd-4350-9c7c-e44c68c16090" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_75720d8a-8cb5-4c4b-8562-8bfcd388b616" xlink:to="loc_us-gaap_EquitySwapMember_43b21de4-9fdd-4350-9c7c-e44c68c16090" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails" xlink:type="extended" id="i0b5f1fdfe351479d9efad05b7d140975_DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLineItems_1ff9649a-1fb1-4411-ac60-14b43438ad3b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsNotDesignatedAsHedgingInstrumentsGainLossNet_a78e0ee7-c0d8-443f-8fc5-1eba5985553f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentsNotDesignatedAsHedgingInstrumentsGainLossNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_1ff9649a-1fb1-4411-ac60-14b43438ad3b" xlink:to="loc_us-gaap_DerivativeInstrumentsNotDesignatedAsHedgingInstrumentsGainLossNet_a78e0ee7-c0d8-443f-8fc5-1eba5985553f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax_fd576ec2-cac5-4ade-beb3-e624f8b0bf48" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_1ff9649a-1fb1-4411-ac60-14b43438ad3b" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax_fd576ec2-cac5-4ade-beb3-e624f8b0bf48" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReclassificationFromAccumulatedOtherComprehensiveIncomeCurrentPeriodBeforeTax_1e9551be-4d82-4b16-894b-0c3d47d01778" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ReclassificationFromAccumulatedOtherComprehensiveIncomeCurrentPeriodBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_1ff9649a-1fb1-4411-ac60-14b43438ad3b" xlink:to="loc_us-gaap_ReclassificationFromAccumulatedOtherComprehensiveIncomeCurrentPeriodBeforeTax_1e9551be-4d82-4b16-894b-0c3d47d01778" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTable_f313b071-6af7-4b59-aa0d-3a6c7db8dc47" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeLineItems_1ff9649a-1fb1-4411-ac60-14b43438ad3b" xlink:to="loc_us-gaap_DerivativeTable_f313b071-6af7-4b59-aa0d-3a6c7db8dc47" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_90317583-0cdb-4e0e-a0eb-5d48d570b559" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_f313b071-6af7-4b59-aa0d-3a6c7db8dc47" xlink:to="loc_us-gaap_HedgingDesignationAxis_90317583-0cdb-4e0e-a0eb-5d48d570b559" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_90317583-0cdb-4e0e-a0eb-5d48d570b559_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_90317583-0cdb-4e0e-a0eb-5d48d570b559" xlink:to="loc_us-gaap_HedgingDesignationDomain_90317583-0cdb-4e0e-a0eb-5d48d570b559_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_c1a63e13-7a7c-4576-b9ff-b5d0d44f5455" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_90317583-0cdb-4e0e-a0eb-5d48d570b559" xlink:to="loc_us-gaap_HedgingDesignationDomain_c1a63e13-7a7c-4576-b9ff-b5d0d44f5455" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_2d747006-abdb-46b6-b2df-d0ec78ffe68f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_c1a63e13-7a7c-4576-b9ff-b5d0d44f5455" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_2d747006-abdb-46b6-b2df-d0ec78ffe68f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_0239619d-3c95-415f-9b67-252a7c6d1f8c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_f313b071-6af7-4b59-aa0d-3a6c7db8dc47" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_0239619d-3c95-415f-9b67-252a7c6d1f8c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_0239619d-3c95-415f-9b67-252a7c6d1f8c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_0239619d-3c95-415f-9b67-252a7c6d1f8c" xlink:to="loc_us-gaap_HedgingRelationshipDomain_0239619d-3c95-415f-9b67-252a7c6d1f8c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_51a4c664-ea36-4437-b071-8743aa0b69ac" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_0239619d-3c95-415f-9b67-252a7c6d1f8c" xlink:to="loc_us-gaap_HedgingRelationshipDomain_51a4c664-ea36-4437-b071-8743aa0b69ac" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgingMember_db9b3edc-97cf-4dc7-ba80-5a48552fe7eb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashFlowHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_51a4c664-ea36-4437-b071-8743aa0b69ac" xlink:to="loc_us-gaap_CashFlowHedgingMember_db9b3edc-97cf-4dc7-ba80-5a48552fe7eb" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_c0b0a3fd-7b70-49b6-9d7a-c11e255fb3f6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_f313b071-6af7-4b59-aa0d-3a6c7db8dc47" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_c0b0a3fd-7b70-49b6-9d7a-c11e255fb3f6" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_c0b0a3fd-7b70-49b6-9d7a-c11e255fb3f6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_c0b0a3fd-7b70-49b6-9d7a-c11e255fb3f6" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_c0b0a3fd-7b70-49b6-9d7a-c11e255fb3f6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_98db671c-45cc-4256-9f2d-8f4ae63b9575" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_c0b0a3fd-7b70-49b6-9d7a-c11e255fb3f6" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_98db671c-45cc-4256-9f2d-8f4ae63b9575" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_ab1980bd-b6a9-49d6-bc12-6c0d0fb8d817" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_98db671c-45cc-4256-9f2d-8f4ae63b9575" xlink:to="loc_us-gaap_CommodityContractMember_ab1980bd-b6a9-49d6-bc12-6c0d0fb8d817" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_47244f74-b55e-42e0-884d-477c63a3e8dc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_98db671c-45cc-4256-9f2d-8f4ae63b9575" xlink:to="loc_us-gaap_ForeignExchangeContractMember_47244f74-b55e-42e0-884d-477c63a3e8dc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestRateContractMember_c3e038fc-9d5b-4e05-94a6-757e20fc10cd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_InterestRateContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_98db671c-45cc-4256-9f2d-8f4ae63b9575" xlink:to="loc_us-gaap_InterestRateContractMember_c3e038fc-9d5b-4e05-94a6-757e20fc10cd" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_3a4cd508-0689-4f7e-b3a1-ffb972afffb7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_98db671c-45cc-4256-9f2d-8f4ae63b9575" xlink:to="loc_us-gaap_EquitySwapMember_3a4cd508-0689-4f7e-b3a1-ffb972afffb7" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#FAIRVALUEMEASUREMENTSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSNARRATIVEDetails" xlink:type="extended" id="i615b54b8fcb04f5c9c97cdc6437c739c_FAIRVALUEMEASUREMENTSNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_c02510f7-07a8-4bbc-aaac-7ee2ba540105" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueNetAssetLiability_ec6f4df3-2b2c-4d19-be93-e050b1f010a3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueNetAssetLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_c02510f7-07a8-4bbc-aaac-7ee2ba540105" xlink:to="loc_us-gaap_FairValueNetAssetLiability_ec6f4df3-2b2c-4d19-be93-e050b1f010a3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetImpairmentCharges_b8b04ac0-a26e-4f86-91ec-66d9e8eaa164" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetImpairmentCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_c02510f7-07a8-4bbc-aaac-7ee2ba540105" xlink:to="loc_us-gaap_AssetImpairmentCharges_b8b04ac0-a26e-4f86-91ec-66d9e8eaa164" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByBalanceSheetGroupingTable_995b7473-67b5-463a-a4e7-e35dc868a3ab" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueByBalanceSheetGroupingTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_c02510f7-07a8-4bbc-aaac-7ee2ba540105" xlink:to="loc_us-gaap_FairValueByBalanceSheetGroupingTable_995b7473-67b5-463a-a4e7-e35dc868a3ab" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_0aa72772-a78a-4169-9046-b845a07e01f6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_995b7473-67b5-463a-a4e7-e35dc868a3ab" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_0aa72772-a78a-4169-9046-b845a07e01f6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_0aa72772-a78a-4169-9046-b845a07e01f6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_0aa72772-a78a-4169-9046-b845a07e01f6" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_0aa72772-a78a-4169-9046-b845a07e01f6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_376c3295-31f4-4671-81e8-d85f75e2b001" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_0aa72772-a78a-4169-9046-b845a07e01f6" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_376c3295-31f4-4671-81e8-d85f75e2b001" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_217be1d8-ee1c-4d8d-bd98-328838062a49" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_376c3295-31f4-4671-81e8-d85f75e2b001" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_217be1d8-ee1c-4d8d-bd98-328838062a49" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails" xlink:type="extended" id="i5bc6e90815d74c9fb3ddce6ff9fb9b21_FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_dd9518e4-6377-4da8-807a-31c210d73953" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_bb61b418-55a7-4c38-88d2-150d0b6de7d3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_dd9518e4-6377-4da8-807a-31c210d73953" xlink:to="loc_us-gaap_DerivativeAssets_bb61b418-55a7-4c38-88d2-150d0b6de7d3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_1c3c293d-51ea-4492-94a3-90ec1ebed830" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_dd9518e4-6377-4da8-807a-31c210d73953" xlink:to="loc_us-gaap_DerivativeLiabilities_1c3c293d-51ea-4492-94a3-90ec1ebed830" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByBalanceSheetGroupingTable_d7f17faf-2dc7-4ab6-aa16-a7c694a9f2c0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueByBalanceSheetGroupingTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_dd9518e4-6377-4da8-807a-31c210d73953" xlink:to="loc_us-gaap_FairValueByBalanceSheetGroupingTable_d7f17faf-2dc7-4ab6-aa16-a7c694a9f2c0" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByMeasurementFrequencyAxis_747f084e-7ee5-4b79-bc6d-6e76d44d1d04" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueByMeasurementFrequencyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_d7f17faf-2dc7-4ab6-aa16-a7c694a9f2c0" xlink:to="loc_us-gaap_FairValueByMeasurementFrequencyAxis_747f084e-7ee5-4b79-bc6d-6e76d44d1d04" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_747f084e-7ee5-4b79-bc6d-6e76d44d1d04_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_747f084e-7ee5-4b79-bc6d-6e76d44d1d04" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_747f084e-7ee5-4b79-bc6d-6e76d44d1d04_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_ee353703-b4a6-4962-86a7-ac5a29bafd91" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_747f084e-7ee5-4b79-bc6d-6e76d44d1d04" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_ee353703-b4a6-4962-86a7-ac5a29bafd91" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsRecurringMember_97e48152-848b-42d1-971f-4936cbd6e5f6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementsRecurringMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementFrequencyDomain_ee353703-b4a6-4962-86a7-ac5a29bafd91" xlink:to="loc_us-gaap_FairValueMeasurementsRecurringMember_97e48152-848b-42d1-971f-4936cbd6e5f6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_3be10718-a420-4625-b612-5312305eaf9d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_d7f17faf-2dc7-4ab6-aa16-a7c694a9f2c0" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_3be10718-a420-4625-b612-5312305eaf9d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_3be10718-a420-4625-b612-5312305eaf9d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_3be10718-a420-4625-b612-5312305eaf9d" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_3be10718-a420-4625-b612-5312305eaf9d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_6a7b4ad4-f0bb-4653-9c62-45cf00290afc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_3be10718-a420-4625-b612-5312305eaf9d" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_6a7b4ad4-f0bb-4653-9c62-45cf00290afc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_a435264b-06c0-43f3-9299-08a112fc05fc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_6a7b4ad4-f0bb-4653-9c62-45cf00290afc" xlink:to="loc_us-gaap_ForeignExchangeContractMember_a435264b-06c0-43f3-9299-08a112fc05fc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_621ae129-2a95-40e7-a606-dcf23e216a3e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_6a7b4ad4-f0bb-4653-9c62-45cf00290afc" xlink:to="loc_us-gaap_EquitySwapMember_621ae129-2a95-40e7-a606-dcf23e216a3e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_499d937f-299f-4f50-8002-7d52356d5ae1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_6a7b4ad4-f0bb-4653-9c62-45cf00290afc" xlink:to="loc_us-gaap_CommodityContractMember_499d937f-299f-4f50-8002-7d52356d5ae1" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_4674f6c6-ac13-4fc9-bfa8-c43ec1262294" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_d7f17faf-2dc7-4ab6-aa16-a7c694a9f2c0" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_4674f6c6-ac13-4fc9-bfa8-c43ec1262294" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_4674f6c6-ac13-4fc9-bfa8-c43ec1262294_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_4674f6c6-ac13-4fc9-bfa8-c43ec1262294" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_4674f6c6-ac13-4fc9-bfa8-c43ec1262294_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_0518c7ed-8486-4635-8587-53180954d570" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_4674f6c6-ac13-4fc9-bfa8-c43ec1262294" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_0518c7ed-8486-4635-8587-53180954d570" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel1Member_e00715c2-5d51-468f-bde2-1ebd56ec3052" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueInputsLevel1Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_0518c7ed-8486-4635-8587-53180954d570" xlink:to="loc_us-gaap_FairValueInputsLevel1Member_e00715c2-5d51-468f-bde2-1ebd56ec3052" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_738a07ff-aeec-495a-ac53-471be6dbc930" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_0518c7ed-8486-4635-8587-53180954d570" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_738a07ff-aeec-495a-ac53-471be6dbc930" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_5156b3ef-0f66-4268-bcb5-bd6af6150077" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_0518c7ed-8486-4635-8587-53180954d570" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_5156b3ef-0f66-4268-bcb5-bd6af6150077" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails" xlink:type="extended" id="i964bb7c165924c218c1a9b7f06f79825_FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ade3337b-f93a-4fcd-ace8-ca00bfaca334" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LongtermDebtCurrentMaturitiesFairValue_d4d2470b-2c71-4c6a-8c1c-53d5e7bca440" xlink:href="hsy-20221002.xsd#hsy_LongtermDebtCurrentMaturitiesFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ade3337b-f93a-4fcd-ace8-ca00bfaca334" xlink:to="loc_hsy_LongtermDebtCurrentMaturitiesFairValue_d4d2470b-2c71-4c6a-8c1c-53d5e7bca440" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LongtermDebtExcludingCurrentMaturitiesFairValue_8d34de45-a643-44bb-b0da-ee904566835f" xlink:href="hsy-20221002.xsd#hsy_LongtermDebtExcludingCurrentMaturitiesFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ade3337b-f93a-4fcd-ace8-ca00bfaca334" xlink:to="loc_hsy_LongtermDebtExcludingCurrentMaturitiesFairValue_8d34de45-a643-44bb-b0da-ee904566835f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtFairValue_6cf6d860-89cc-440c-8e8c-0080374a6398" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebtFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ade3337b-f93a-4fcd-ace8-ca00bfaca334" xlink:to="loc_us-gaap_LongTermDebtFairValue_6cf6d860-89cc-440c-8e8c-0080374a6398" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtCurrent_3b5c2bec-eff3-44d8-9718-e6d27abcbd98" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebtCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ade3337b-f93a-4fcd-ace8-ca00bfaca334" xlink:to="loc_us-gaap_LongTermDebtCurrent_3b5c2bec-eff3-44d8-9718-e6d27abcbd98" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtNoncurrent_90f19a12-cd34-4ab3-ae33-71899a4c8b53" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebtNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ade3337b-f93a-4fcd-ace8-ca00bfaca334" xlink:to="loc_us-gaap_LongTermDebtNoncurrent_90f19a12-cd34-4ab3-ae33-71899a4c8b53" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebt_12f7cd15-b5dd-48ff-af90-8a76a9d04040" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebt"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ade3337b-f93a-4fcd-ace8-ca00bfaca334" xlink:to="loc_us-gaap_LongTermDebt_12f7cd15-b5dd-48ff-af90-8a76a9d04040" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_f37dbaae-e691-4b52-bb6b-104104361645" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ade3337b-f93a-4fcd-ace8-ca00bfaca334" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_f37dbaae-e691-4b52-bb6b-104104361645" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_c39b07e1-8fe1-414b-9b9d-ed9a56086721" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_f37dbaae-e691-4b52-bb6b-104104361645" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_c39b07e1-8fe1-414b-9b9d-ed9a56086721" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_c39b07e1-8fe1-414b-9b9d-ed9a56086721_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_c39b07e1-8fe1-414b-9b9d-ed9a56086721" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_c39b07e1-8fe1-414b-9b9d-ed9a56086721_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_a47998af-c29e-4966-ba9a-a49117d7001f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_c39b07e1-8fe1-414b-9b9d-ed9a56086721" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_a47998af-c29e-4966-ba9a-a49117d7001f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_c1837003-dde5-41c2-8a73-89228cee797a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_a47998af-c29e-4966-ba9a-a49117d7001f" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_c1837003-dde5-41c2-8a73-89228cee797a" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails" xlink:type="extended" id="ib96f528b18794d46966673cf068f78d8_LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeLeaseDescriptionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_610e65a1-af10-46a7-beae-22e67417b029" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_610e65a1-af10-46a7-beae-22e67417b029" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAsset_0857c289-5661-4157-958c-21c464e25816" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FinanceLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAsset_0857c289-5661-4157-958c-21c464e25816" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization_cd6f1684-53a9-41e9-917c-31c1f8c5904e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization_cd6f1684-53a9-41e9-917c-31c1f8c5904e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LeaseRightofUseAsset_72035768-41b8-4e7b-8678-a95afa708040" xlink:href="hsy-20221002.xsd#hsy_LeaseRightofUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:to="loc_hsy_LeaseRightofUseAsset_72035768-41b8-4e7b-8678-a95afa708040" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityCurrent_1e7a37d5-a98e-45d3-8c23-2e067b1a2236" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseLiabilityCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:to="loc_us-gaap_OperatingLeaseLiabilityCurrent_1e7a37d5-a98e-45d3-8c23-2e067b1a2236" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiabilityCurrent_ad81e0ae-fa40-4c11-83ec-460b273e1f68" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FinanceLeaseLiabilityCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:to="loc_us-gaap_FinanceLeaseLiabilityCurrent_ad81e0ae-fa40-4c11-83ec-460b273e1f68" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_b0a3c723-40b1-4296-871a-0d0ff62c0459" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:to="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_b0a3c723-40b1-4296-871a-0d0ff62c0459" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiabilityNoncurrent_e4e05ee8-1b86-40a3-b5ef-1c90d2f47b3d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FinanceLeaseLiabilityNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:to="loc_us-gaap_FinanceLeaseLiabilityNoncurrent_e4e05ee8-1b86-40a3-b5ef-1c90d2f47b3d" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LeaseLiability_9bf74a8f-41f0-4808-b6a6-506ecbe8db69" xlink:href="hsy-20221002.xsd#hsy_LeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:to="loc_hsy_LeaseLiability_9bf74a8f-41f0-4808-b6a6-506ecbe8db69" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionTable_9aa521f0-f4e1-4799-8cfe-3099a7864c61" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeLeaseDescriptionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_fa313866-a779-4391-a1e2-8b3b4b993c11" xlink:to="loc_us-gaap_LesseeLeaseDescriptionTable_9aa521f0-f4e1-4799-8cfe-3099a7864c61" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_c4628bcb-64ac-401a-b4a8-daf859f57f74" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LesseeLeaseDescriptionTable_9aa521f0-f4e1-4799-8cfe-3099a7864c61" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_c4628bcb-64ac-401a-b4a8-daf859f57f74" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_c4628bcb-64ac-401a-b4a8-daf859f57f74_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_c4628bcb-64ac-401a-b4a8-daf859f57f74" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_c4628bcb-64ac-401a-b4a8-daf859f57f74_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_1e07a832-49c9-4ef8-b734-3e171a0763bd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_c4628bcb-64ac-401a-b4a8-daf859f57f74" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_1e07a832-49c9-4ef8-b734-3e171a0763bd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PropertyPlantandEquipmentGrossMember_79d5b525-cf19-4b29-8e78-7b4cd28b137d" xlink:href="hsy-20221002.xsd#hsy_PropertyPlantandEquipmentGrossMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_1e07a832-49c9-4ef8-b734-3e171a0763bd" xlink:to="loc_hsy_PropertyPlantandEquipmentGrossMember_79d5b525-cf19-4b29-8e78-7b4cd28b137d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_AccumulatedDepreciationMember_c893f692-1b40-4250-8819-0a4b35e19db2" xlink:href="hsy-20221002.xsd#hsy_AccumulatedDepreciationMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_1e07a832-49c9-4ef8-b734-3e171a0763bd" xlink:to="loc_hsy_AccumulatedDepreciationMember_c893f692-1b40-4250-8819-0a4b35e19db2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentMember_d4cadd6e-f701-4560-a213-9b1a4e8da9d3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PropertyPlantAndEquipmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_1e07a832-49c9-4ef8-b734-3e171a0763bd" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentMember_d4cadd6e-f701-4560-a213-9b1a4e8da9d3" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails" xlink:type="extended" id="i9d6adf26354b445f83c9d7d2b0da0294_INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_f360f661-9314-41a2-8c94-e2c4c99c3f92" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure_43a2a23f-bca6-4a4b-bc45-b072dd045658" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f360f661-9314-41a2-8c94-e2c4c99c3f92" xlink:to="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure_43a2a23f-bca6-4a4b-bc45-b072dd045658" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_021f8257-3fd4-4f80-8948-ecd59b5e7f87" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f360f661-9314-41a2-8c94-e2c4c99c3f92" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_021f8257-3fd4-4f80-8948-ecd59b5e7f87" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_2a739d13-511b-46ad-89ea-d9fe11f64c83" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_021f8257-3fd4-4f80-8948-ecd59b5e7f87" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_2a739d13-511b-46ad-89ea-d9fe11f64c83" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_2a739d13-511b-46ad-89ea-d9fe11f64c83_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_2a739d13-511b-46ad-89ea-d9fe11f64c83" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_2a739d13-511b-46ad-89ea-d9fe11f64c83_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_7a175658-9284-4608-a305-3bdf065460f9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_2a739d13-511b-46ad-89ea-d9fe11f64c83" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_7a175658-9284-4608-a305-3bdf065460f9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNoncurrentAssetsMember_659d9fda-72e2-4faf-8413-f82a484745c3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherNoncurrentAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_7a175658-9284-4608-a305-3bdf065460f9" xlink:to="loc_us-gaap_OtherNoncurrentAssetsMember_659d9fda-72e2-4faf-8413-f82a484745c3" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails" xlink:type="extended" id="i4f67fb2de411487da8610505f4a32572_BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveLineItems_2b6c458e-c767-4bc8-9672-c6f0cf3a8798" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringCostAndReserveLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_d00e65f3-b4a7-42cd-aa76-dec78c3d72fd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_2b6c458e-c767-4bc8-9672-c6f0cf3a8798" xlink:to="loc_us-gaap_RestructuringCharges_d00e65f3-b4a7-42cd-aa76-dec78c3d72fd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_bf0167f7-ef21-4a6f-8826-65ad155ab3d3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_2b6c458e-c767-4bc8-9672-c6f0cf3a8798" xlink:to="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_bf0167f7-ef21-4a6f-8826-65ad155ab3d3" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveAxis_5069bc0d-273c-475e-afd3-bb757da529cf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringCostAndReserveAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_bf0167f7-ef21-4a6f-8826-65ad155ab3d3" xlink:to="loc_us-gaap_RestructuringCostAndReserveAxis_5069bc0d-273c-475e-afd3-bb757da529cf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_5069bc0d-273c-475e-afd3-bb757da529cf_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_5069bc0d-273c-475e-afd3-bb757da529cf" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_5069bc0d-273c-475e-afd3-bb757da529cf_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_1bb7cfce-80ba-436c-b052-6adc21ad8dc4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_5069bc0d-273c-475e-afd3-bb757da529cf" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_1bb7cfce-80ba-436c-b052-6adc21ad8dc4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeSeveranceMember_b097c03d-1870-4c92-a579-877a8600b55f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeSeveranceMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_1bb7cfce-80ba-436c-b052-6adc21ad8dc4" xlink:to="loc_us-gaap_EmployeeSeveranceMember_b097c03d-1870-4c92-a579-877a8600b55f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherRestructuringMember_19bc40c3-4452-4985-8182-4f412acfeccd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherRestructuringMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_1bb7cfce-80ba-436c-b052-6adc21ad8dc4" xlink:to="loc_us-gaap_OtherRestructuringMember_19bc40c3-4452-4985-8182-4f412acfeccd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanAxis_cd349177-4edb-425e-b08e-ddf5673db958" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringPlanAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_bf0167f7-ef21-4a6f-8826-65ad155ab3d3" xlink:to="loc_us-gaap_RestructuringPlanAxis_cd349177-4edb-425e-b08e-ddf5673db958" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_cd349177-4edb-425e-b08e-ddf5673db958_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringPlanAxis_cd349177-4edb-425e-b08e-ddf5673db958" xlink:to="loc_us-gaap_RestructuringPlanDomain_cd349177-4edb-425e-b08e-ddf5673db958_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_e23f6f3b-1e47-495a-9cf3-26123a213198" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringPlanAxis_cd349177-4edb-425e-b08e-ddf5673db958" xlink:to="loc_us-gaap_RestructuringPlanDomain_e23f6f3b-1e47-495a-9cf3-26123a213198" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalOptimizationProgramMember_a95b7eda-f76e-449d-9285-94b51f9c45ab" xlink:href="hsy-20221002.xsd#hsy_InternationalOptimizationProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringPlanDomain_e23f6f3b-1e47-495a-9cf3-26123a213198" xlink:to="loc_hsy_InternationalOptimizationProgramMember_a95b7eda-f76e-449d-9285-94b51f9c45ab" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationAxis_d2c0474d-e78e-490d-a2b8-8932f45dcfa5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_bf0167f7-ef21-4a6f-8826-65ad155ab3d3" xlink:to="loc_us-gaap_IncomeStatementLocationAxis_d2c0474d-e78e-490d-a2b8-8932f45dcfa5" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_d2c0474d-e78e-490d-a2b8-8932f45dcfa5_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_d2c0474d-e78e-490d-a2b8-8932f45dcfa5" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_d2c0474d-e78e-490d-a2b8-8932f45dcfa5_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_648c3835-f3bb-40f1-adad-0a941819dbe6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_d2c0474d-e78e-490d-a2b8-8932f45dcfa5" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_648c3835-f3bb-40f1-adad-0a941819dbe6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfSalesMember_edb0f7e2-ad7a-4cd9-bd55-e7a4ef9a7eae" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CostOfSalesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_648c3835-f3bb-40f1-adad-0a941819dbe6" xlink:to="loc_us-gaap_CostOfSalesMember_edb0f7e2-ad7a-4cd9-bd55-e7a4ef9a7eae" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpensesMember_d6f709bd-6fb6-411d-a7db-a3cad0467d8f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SellingGeneralAndAdministrativeExpensesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_648c3835-f3bb-40f1-adad-0a941819dbe6" xlink:to="loc_us-gaap_SellingGeneralAndAdministrativeExpensesMember_d6f709bd-6fb6-411d-a7db-a3cad0467d8f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringChargesMember_1c11f6a0-6dce-40a1-a6f0-5557c13218c2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringChargesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_648c3835-f3bb-40f1-adad-0a941819dbe6" xlink:to="loc_us-gaap_RestructuringChargesMember_1c11f6a0-6dce-40a1-a6f0-5557c13218c2" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails" xlink:type="extended" id="ib30418d985364de686afbf7b14169446_BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveLineItems_eb93da86-4de4-4d5b-9077-9fe07d2d08e3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringCostAndReserveLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedCostExpectedCost1_b9943c23-5993-4a80-a158-4721f17ded1e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringAndRelatedCostExpectedCost1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_eb93da86-4de4-4d5b-9077-9fe07d2d08e3" xlink:to="loc_us-gaap_RestructuringAndRelatedCostExpectedCost1_b9943c23-5993-4a80-a158-4721f17ded1e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_RestructuringandRelatedCostExpectedCostCashPortion_105bf81c-5113-40bd-9e5c-c063e301d247" xlink:href="hsy-20221002.xsd#hsy_RestructuringandRelatedCostExpectedCostCashPortion"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_eb93da86-4de4-4d5b-9077-9fe07d2d08e3" xlink:to="loc_hsy_RestructuringandRelatedCostExpectedCostCashPortion_105bf81c-5113-40bd-9e5c-c063e301d247" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedCostExpectedNumberOfPositionsEliminated_2cecc46f-dd14-4224-8a03-15f605ed46f7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringAndRelatedCostExpectedNumberOfPositionsEliminated"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_eb93da86-4de4-4d5b-9077-9fe07d2d08e3" xlink:to="loc_us-gaap_RestructuringAndRelatedCostExpectedNumberOfPositionsEliminated_2cecc46f-dd14-4224-8a03-15f605ed46f7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_7f9b8ac3-d196-44ee-a9d5-e2cea65717f8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_eb93da86-4de4-4d5b-9077-9fe07d2d08e3" xlink:to="loc_us-gaap_RestructuringCharges_7f9b8ac3-d196-44ee-a9d5-e2cea65717f8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedCostCostIncurredToDate1_9be5df22-e2e1-4e15-bd56-c3c884bc33d5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringAndRelatedCostCostIncurredToDate1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_eb93da86-4de4-4d5b-9077-9fe07d2d08e3" xlink:to="loc_us-gaap_RestructuringAndRelatedCostCostIncurredToDate1_9be5df22-e2e1-4e15-bd56-c3c884bc33d5" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_4f7fde8f-3acf-4337-9f44-48c676b96664" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_eb93da86-4de4-4d5b-9077-9fe07d2d08e3" xlink:to="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_4f7fde8f-3acf-4337-9f44-48c676b96664" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_be060e73-bb46-4018-be50-fe3f13ec9ddb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ConcentrationRiskByBenchmarkAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_4f7fde8f-3acf-4337-9f44-48c676b96664" xlink:to="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_be060e73-bb46-4018-be50-fe3f13ec9ddb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain_be060e73-bb46-4018-be50-fe3f13ec9ddb_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ConcentrationRiskBenchmarkDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_be060e73-bb46-4018-be50-fe3f13ec9ddb" xlink:to="loc_us-gaap_ConcentrationRiskBenchmarkDomain_be060e73-bb46-4018-be50-fe3f13ec9ddb_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain_519bbf36-0f9c-4c0e-afdb-c993a1254aa3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ConcentrationRiskBenchmarkDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_be060e73-bb46-4018-be50-fe3f13ec9ddb" xlink:to="loc_us-gaap_ConcentrationRiskBenchmarkDomain_519bbf36-0f9c-4c0e-afdb-c993a1254aa3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskByTypeAxis_8e44d60d-9860-4a48-be65-e655df22f22f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ConcentrationRiskByTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_4f7fde8f-3acf-4337-9f44-48c676b96664" xlink:to="loc_us-gaap_ConcentrationRiskByTypeAxis_8e44d60d-9860-4a48-be65-e655df22f22f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain_8e44d60d-9860-4a48-be65-e655df22f22f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ConcentrationRiskTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis_8e44d60d-9860-4a48-be65-e655df22f22f" xlink:to="loc_us-gaap_ConcentrationRiskTypeDomain_8e44d60d-9860-4a48-be65-e655df22f22f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain_7a34e921-2771-4803-8f90-d3530cdc446e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ConcentrationRiskTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis_8e44d60d-9860-4a48-be65-e655df22f22f" xlink:to="loc_us-gaap_ConcentrationRiskTypeDomain_7a34e921-2771-4803-8f90-d3530cdc446e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_3c8d1c57-c5f0-4e4e-b4c5-93604069773e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_4f7fde8f-3acf-4337-9f44-48c676b96664" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_3c8d1c57-c5f0-4e4e-b4c5-93604069773e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_3c8d1c57-c5f0-4e4e-b4c5-93604069773e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_3c8d1c57-c5f0-4e4e-b4c5-93604069773e" xlink:to="loc_us-gaap_SegmentDomain_3c8d1c57-c5f0-4e4e-b4c5-93604069773e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_ff5afffd-e647-473f-ab5c-e1b6296994d2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_3c8d1c57-c5f0-4e4e-b4c5-93604069773e" xlink:to="loc_us-gaap_SegmentDomain_ff5afffd-e647-473f-ab5c-e1b6296994d2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanAxis_e6b15baf-7a13-4396-be42-cc68208622ae" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringPlanAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_4f7fde8f-3acf-4337-9f44-48c676b96664" xlink:to="loc_us-gaap_RestructuringPlanAxis_e6b15baf-7a13-4396-be42-cc68208622ae" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_e6b15baf-7a13-4396-be42-cc68208622ae_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringPlanAxis_e6b15baf-7a13-4396-be42-cc68208622ae" xlink:to="loc_us-gaap_RestructuringPlanDomain_e6b15baf-7a13-4396-be42-cc68208622ae_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_615a303b-6058-4948-9b51-06a824c76564" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringPlanAxis_e6b15baf-7a13-4396-be42-cc68208622ae" xlink:to="loc_us-gaap_RestructuringPlanDomain_615a303b-6058-4948-9b51-06a824c76564" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalOptimizationProgramMember_d14b70b2-c841-4a97-97e0-b877c850a3dd" xlink:href="hsy-20221002.xsd#hsy_InternationalOptimizationProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringPlanDomain_615a303b-6058-4948-9b51-06a824c76564" xlink:to="loc_hsy_InternationalOptimizationProgramMember_d14b70b2-c841-4a97-97e0-b877c850a3dd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_45fc28bb-639b-431e-9160-408431530370" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_4f7fde8f-3acf-4337-9f44-48c676b96664" xlink:to="loc_srt_RangeAxis_45fc28bb-639b-431e-9160-408431530370" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_45fc28bb-639b-431e-9160-408431530370_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_45fc28bb-639b-431e-9160-408431530370" xlink:to="loc_srt_RangeMember_45fc28bb-639b-431e-9160-408431530370_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_c59b7a7a-7a80-4c50-8592-8e8acbfefa8a" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_45fc28bb-639b-431e-9160-408431530370" xlink:to="loc_srt_RangeMember_c59b7a7a-7a80-4c50-8592-8e8acbfefa8a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_2fe8caf4-0a63-4834-9fd1-6c0ba00c9809" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_c59b7a7a-7a80-4c50-8592-8e8acbfefa8a" xlink:to="loc_srt_MinimumMember_2fe8caf4-0a63-4834-9fd1-6c0ba00c9809" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_84275610-2ef0-4b77-87c5-a6a7b8645664" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_c59b7a7a-7a80-4c50-8592-8e8acbfefa8a" xlink:to="loc_srt_MaximumMember_84275610-2ef0-4b77-87c5-a6a7b8645664" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementGeographicalAxis_19691736-b656-4bce-a367-8bd03ec5c7e4" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_StatementGeographicalAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_4f7fde8f-3acf-4337-9f44-48c676b96664" xlink:to="loc_srt_StatementGeographicalAxis_19691736-b656-4bce-a367-8bd03ec5c7e4" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_19691736-b656-4bce-a367-8bd03ec5c7e4_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_19691736-b656-4bce-a367-8bd03ec5c7e4" xlink:to="loc_srt_SegmentGeographicalDomain_19691736-b656-4bce-a367-8bd03ec5c7e4_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_bbf9e453-a9da-4f74-a1e1-febe8e1c462a" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_19691736-b656-4bce-a367-8bd03ec5c7e4" xlink:to="loc_srt_SegmentGeographicalDomain_bbf9e453-a9da-4f74-a1e1-febe8e1c462a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonUsMember_3e9d0001-1fa1-471b-ad01-05eb70662328" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NonUsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_bbf9e453-a9da-4f74-a1e1-febe8e1c462a" xlink:to="loc_us-gaap_NonUsMember_3e9d0001-1fa1-471b-ad01-05eb70662328" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails" xlink:type="extended" id="icbccd4b6d0134b41a4c03f8e574fe4dc_PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_ac67536a-4392-46e5-82f3-c1eeda43755b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanServiceCost_80486f15-61d7-4d56-8195-7256eaed2f93" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanServiceCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_ac67536a-4392-46e5-82f3-c1eeda43755b" xlink:to="loc_us-gaap_DefinedBenefitPlanServiceCost_80486f15-61d7-4d56-8195-7256eaed2f93" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanInterestCost_497c0700-4931-4991-998b-1a777f900f2e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanInterestCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_ac67536a-4392-46e5-82f3-c1eeda43755b" xlink:to="loc_us-gaap_DefinedBenefitPlanInterestCost_497c0700-4931-4991-998b-1a777f900f2e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets_1fb5be4b-2034-480e-938d-bda2a6ec516d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_ac67536a-4392-46e5-82f3-c1eeda43755b" xlink:to="loc_us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets_1fb5be4b-2034-480e-938d-bda2a6ec516d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit_957eda46-f686-45fe-a701-38890431abec" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_ac67536a-4392-46e5-82f3-c1eeda43755b" xlink:to="loc_us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit_957eda46-f686-45fe-a701-38890431abec" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses_45ea5127-7a82-4048-828b-928f97aff23a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_ac67536a-4392-46e5-82f3-c1eeda43755b" xlink:to="loc_us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses_45ea5127-7a82-4048-828b-928f97aff23a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanRecognizedNetGainLossDueToSettlements1_8a9bf0bf-5032-458b-9d93-643759d3500f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanRecognizedNetGainLossDueToSettlements1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_ac67536a-4392-46e5-82f3-c1eeda43755b" xlink:to="loc_us-gaap_DefinedBenefitPlanRecognizedNetGainLossDueToSettlements1_8a9bf0bf-5032-458b-9d93-643759d3500f" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost_803738ec-da29-458c-b5db-ef15bcee01f6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_ac67536a-4392-46e5-82f3-c1eeda43755b" xlink:to="loc_us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost_803738ec-da29-458c-b5db-ef15bcee01f6" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_0d0e6ca3-0bf4-4a06-acfa-63dfdc5c4441" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_ac67536a-4392-46e5-82f3-c1eeda43755b" xlink:to="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_0d0e6ca3-0bf4-4a06-acfa-63dfdc5c4441" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeAxis_ba07cd16-2168-4323-905d-c55520777d88" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetirementPlanTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_0d0e6ca3-0bf4-4a06-acfa-63dfdc5c4441" xlink:to="loc_us-gaap_RetirementPlanTypeAxis_ba07cd16-2168-4323-905d-c55520777d88" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_ba07cd16-2168-4323-905d-c55520777d88_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_ba07cd16-2168-4323-905d-c55520777d88" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_ba07cd16-2168-4323-905d-c55520777d88_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_2402c955-8189-4b5e-aa97-5e1fbb4729d0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_ba07cd16-2168-4323-905d-c55520777d88" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_2402c955-8189-4b5e-aa97-5e1fbb4729d0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PensionPlansDefinedBenefitMember_d631a0d8-e7d1-414d-8880-29fb66b45530" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PensionPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_2402c955-8189-4b5e-aa97-5e1fbb4729d0" xlink:to="loc_us-gaap_PensionPlansDefinedBenefitMember_d631a0d8-e7d1-414d-8880-29fb66b45530" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_d84c5b87-5f78-411b-a59a-c3312ccdfd95" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_2402c955-8189-4b5e-aa97-5e1fbb4729d0" xlink:to="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_d84c5b87-5f78-411b-a59a-c3312ccdfd95" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails" xlink:type="extended" id="i42fdf05265f64edb8ee06bd8e6d42aa8_PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_f42f3cb5-168e-48ab-8928-3cd02daab9df" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanContributionsByEmployer_f3583940-f77b-428d-8edf-9755c835f962" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanContributionsByEmployer"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_f42f3cb5-168e-48ab-8928-3cd02daab9df" xlink:to="loc_us-gaap_DefinedBenefitPlanContributionsByEmployer_f3583940-f77b-428d-8edf-9755c835f962" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DefinedBenefitPlanRemeasurementBasisSpreadOnDiscountRate_fa2d5386-55ad-4307-bdbf-8343116f6467" xlink:href="hsy-20221002.xsd#hsy_DefinedBenefitPlanRemeasurementBasisSpreadOnDiscountRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_f42f3cb5-168e-48ab-8928-3cd02daab9df" xlink:to="loc_hsy_DefinedBenefitPlanRemeasurementBasisSpreadOnDiscountRate_fa2d5386-55ad-4307-bdbf-8343116f6467" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanAssumptionsUsedCalculatingNetPeriodicBenefitCostExpectedLongTermReturnOnAssets_fa7dd4bd-e1d2-49cb-9e4a-b1267b2a4fc3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DefinedBenefitPlanAssumptionsUsedCalculatingNetPeriodicBenefitCostExpectedLongTermReturnOnAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_f42f3cb5-168e-48ab-8928-3cd02daab9df" xlink:to="loc_us-gaap_DefinedBenefitPlanAssumptionsUsedCalculatingNetPeriodicBenefitCostExpectedLongTermReturnOnAssets_fa7dd4bd-e1d2-49cb-9e4a-b1267b2a4fc3" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_46c86792-865c-426a-b5a6-731dd26a3f2e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_f42f3cb5-168e-48ab-8928-3cd02daab9df" xlink:to="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_46c86792-865c-426a-b5a6-731dd26a3f2e" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeAxis_cddb5f7e-652a-4aaa-a96f-835cf09c0e7b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetirementPlanTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_46c86792-865c-426a-b5a6-731dd26a3f2e" xlink:to="loc_us-gaap_RetirementPlanTypeAxis_cddb5f7e-652a-4aaa-a96f-835cf09c0e7b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_cddb5f7e-652a-4aaa-a96f-835cf09c0e7b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_cddb5f7e-652a-4aaa-a96f-835cf09c0e7b" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_cddb5f7e-652a-4aaa-a96f-835cf09c0e7b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_2a440bea-0fba-44b9-a134-dc9981362a10" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_cddb5f7e-652a-4aaa-a96f-835cf09c0e7b" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_2a440bea-0fba-44b9-a134-dc9981362a10" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PensionPlansDefinedBenefitMember_21acece4-6886-4442-aaad-bc1a84a8b473" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PensionPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_2a440bea-0fba-44b9-a134-dc9981362a10" xlink:to="loc_us-gaap_PensionPlansDefinedBenefitMember_21acece4-6886-4442-aaad-bc1a84a8b473" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_fafa52c1-edbd-4f83-be43-6bd67017e689" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_2a440bea-0fba-44b9-a134-dc9981362a10" xlink:to="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_fafa52c1-edbd-4f83-be43-6bd67017e689" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanNameAxis_24a811cc-5358-426c-87af-6b9d88c35170" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetirementPlanNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_46c86792-865c-426a-b5a6-731dd26a3f2e" xlink:to="loc_us-gaap_RetirementPlanNameAxis_24a811cc-5358-426c-87af-6b9d88c35170" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanNameDomain_24a811cc-5358-426c-87af-6b9d88c35170_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetirementPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RetirementPlanNameAxis_24a811cc-5358-426c-87af-6b9d88c35170" xlink:to="loc_us-gaap_RetirementPlanNameDomain_24a811cc-5358-426c-87af-6b9d88c35170_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanNameDomain_5d7d8649-4516-460f-8426-2076b95b72c4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetirementPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RetirementPlanNameAxis_24a811cc-5358-426c-87af-6b9d88c35170" xlink:to="loc_us-gaap_RetirementPlanNameDomain_5d7d8649-4516-460f-8426-2076b95b72c4" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#STOCKCOMPENSATIONPLANSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSNARRATIVEDetails" xlink:type="extended" id="ie10dc0d0caf843c797043f4239043002_STOCKCOMPENSATIONPLANSNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_d6181744-6c23-4300-ad61-3dca786c85f6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_d6181744-6c23-4300-ad61-3dca786c85f6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_6d5f1c9c-29a2-4bb2-a6f2-5d0a1c06ab02" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_6d5f1c9c-29a2-4bb2-a6f2-5d0a1c06ab02" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_08331f54-1f4f-47bd-8635-631a2c225259" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_08331f54-1f4f-47bd-8635-631a2c225259" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_067f913a-b24f-4903-8c3c-626f7468928a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_067f913a-b24f-4903-8c3c-626f7468928a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_a6313736-ea68-476d-b438-41cf689e4017" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_a6313736-ea68-476d-b438-41cf689e4017" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue_cba27aba-1a54-4cae-9f61-122c66ddb333" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue_cba27aba-1a54-4cae-9f61-122c66ddb333" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1_56f6ff38-2c32-4ed3-9ca5-017983b5ab3b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1_56f6ff38-2c32-4ed3-9ca5-017983b5ab3b" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardPerformanceScoreTargetAmounts_c56d8933-e461-48b8-a969-604cd4416074" xlink:href="hsy-20221002.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardPerformanceScoreTargetAmounts"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardPerformanceScoreTargetAmounts_c56d8933-e461-48b8-a969-604cd4416074" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardIntrinsicValueOfShareBasedLiabilitiesPaidCombinedWithFairValueOfSharesVested_e755bbc5-64c1-4907-8d8c-37df5d7cc89a" xlink:href="hsy-20221002.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardIntrinsicValueOfShareBasedLiabilitiesPaidCombinedWithFairValueOfSharesVested"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardIntrinsicValueOfShareBasedLiabilitiesPaidCombinedWithFairValueOfSharesVested_e755bbc5-64c1-4907-8d8c-37df5d7cc89a" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredCompensationArrangementWithIndividualSharesIssued_3eb6d023-d96e-4da6-8d6a-7ac019e7e999" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredCompensationArrangementWithIndividualSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_us-gaap_DeferredCompensationArrangementWithIndividualSharesIssued_3eb6d023-d96e-4da6-8d6a-7ac019e7e999" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DeferredCompensationArrangementwithIndividualConversionBasis_0ecc28cb-1ca5-475a-a3c4-e937c62b5534" xlink:href="hsy-20221002.xsd#hsy_DeferredCompensationArrangementwithIndividualConversionBasis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_hsy_DeferredCompensationArrangementwithIndividualConversionBasis_0ecc28cb-1ca5-475a-a3c4-e937c62b5534" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_632a9be5-7f60-4145-8961-8dd831973da1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_458ca87e-11ae-44b5-8ccf-ee80dab4231f" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_632a9be5-7f60-4145-8961-8dd831973da1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_191581fc-9203-4107-915a-0628b0afd064" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_632a9be5-7f60-4145-8961-8dd831973da1" xlink:to="loc_us-gaap_AwardTypeAxis_191581fc-9203-4107-915a-0628b0afd064" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_191581fc-9203-4107-915a-0628b0afd064_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_191581fc-9203-4107-915a-0628b0afd064" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_191581fc-9203-4107-915a-0628b0afd064_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_7703f411-eabe-49ef-ad28-0794f4374ba1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_191581fc-9203-4107-915a-0628b0afd064" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_7703f411-eabe-49ef-ad28-0794f4374ba1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_7f053d17-3400-4bf5-9c15-15222b9df9bc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_7703f411-eabe-49ef-ad28-0794f4374ba1" xlink:to="loc_us-gaap_EmployeeStockOptionMember_7f053d17-3400-4bf5-9c15-15222b9df9bc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceStockUnitsandRestrictedStockUnitsMember_056650fd-1ab0-40fb-b44e-3c434d10f753" xlink:href="hsy-20221002.xsd#hsy_PerformanceStockUnitsandRestrictedStockUnitsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_7703f411-eabe-49ef-ad28-0794f4374ba1" xlink:to="loc_hsy_PerformanceStockUnitsandRestrictedStockUnitsMember_056650fd-1ab0-40fb-b44e-3c434d10f753" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_c30e7aaa-ff72-4d81-a334-c6c78f39c824" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_632a9be5-7f60-4145-8961-8dd831973da1" xlink:to="loc_srt_RangeAxis_c30e7aaa-ff72-4d81-a334-c6c78f39c824" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_c30e7aaa-ff72-4d81-a334-c6c78f39c824_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_c30e7aaa-ff72-4d81-a334-c6c78f39c824" xlink:to="loc_srt_RangeMember_c30e7aaa-ff72-4d81-a334-c6c78f39c824_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_6ac37c67-3ca8-4197-8c8e-e11c85d5bdbf" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_c30e7aaa-ff72-4d81-a334-c6c78f39c824" xlink:to="loc_srt_RangeMember_6ac37c67-3ca8-4197-8c8e-e11c85d5bdbf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_01fe3297-b327-4242-90cc-11d60f02bf4a" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_6ac37c67-3ca8-4197-8c8e-e11c85d5bdbf" xlink:to="loc_srt_MinimumMember_01fe3297-b327-4242-90cc-11d60f02bf4a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_12a5aba1-9250-4a78-8724-6c7bed57d52a" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_6ac37c67-3ca8-4197-8c8e-e11c85d5bdbf" xlink:to="loc_srt_MaximumMember_12a5aba1-9250-4a78-8724-6c7bed57d52a" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails" xlink:type="extended" id="i8ea052ce3f2e4367834bb3aa04b550c1_STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600e1f0b-f6d1-458e-bdb0-8bce80be5a3f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_75737fab-bd31-4034-8aaf-045a12af1603" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600e1f0b-f6d1-458e-bdb0-8bce80be5a3f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_75737fab-bd31-4034-8aaf-045a12af1603" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_f3476af1-81d2-4907-9268-154a22352eb3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_75737fab-bd31-4034-8aaf-045a12af1603" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_f3476af1-81d2-4907-9268-154a22352eb3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_6e45c20c-27f8-4cec-9a8e-1e63a8ab4684" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_75737fab-bd31-4034-8aaf-045a12af1603" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_6e45c20c-27f8-4cec-9a8e-1e63a8ab4684" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChange_d42a170c-352e-42eb-ba08-446eee35fcde" xlink:href="hsy-20221002.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChange"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_75737fab-bd31-4034-8aaf-045a12af1603" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChange_d42a170c-352e-42eb-ba08-446eee35fcde" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_22924e96-7932-4239-8c38-8288b6dd8404" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_75737fab-bd31-4034-8aaf-045a12af1603" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_22924e96-7932-4239-8c38-8288b6dd8404" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_a0ed230c-723e-491d-a6c8-67bef8b97e29" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_75737fab-bd31-4034-8aaf-045a12af1603" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_a0ed230c-723e-491d-a6c8-67bef8b97e29" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_0374bff1-ffea-44b4-bde3-08adf32a2350" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_b8e7a3c1-2914-444a-bff4-d49c60fad3ba" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600e1f0b-f6d1-458e-bdb0-8bce80be5a3f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_b8e7a3c1-2914-444a-bff4-d49c60fad3ba" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_a221d922-8e5b-4ddd-903e-bcdd73898c83" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_b8e7a3c1-2914-444a-bff4-d49c60fad3ba" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_a221d922-8e5b-4ddd-903e-bcdd73898c83" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_58bc6397-14e7-46b4-8f0f-fb3a879c55c8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_b8e7a3c1-2914-444a-bff4-d49c60fad3ba" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_58bc6397-14e7-46b4-8f0f-fb3a879c55c8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChangeWeightedAverageGrantDateFairValue_6c021c99-912a-419d-ba73-21c68784bc26" xlink:href="hsy-20221002.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChangeWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_b8e7a3c1-2914-444a-bff4-d49c60fad3ba" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChangeWeightedAverageGrantDateFairValue_6c021c99-912a-419d-ba73-21c68784bc26" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_af0d4972-762a-4df1-8e12-297dace7dfa7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_b8e7a3c1-2914-444a-bff4-d49c60fad3ba" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_af0d4972-762a-4df1-8e12-297dace7dfa7" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_1463c1ff-59e5-4dbe-9579-f0127ee1fb75" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_b8e7a3c1-2914-444a-bff4-d49c60fad3ba" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_1463c1ff-59e5-4dbe-9579-f0127ee1fb75" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_ed596380-a84a-4db9-87b6-b672b6094e60" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_64aa730e-18ea-4544-9fb0-29ef64708014" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_600e1f0b-f6d1-458e-bdb0-8bce80be5a3f" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_64aa730e-18ea-4544-9fb0-29ef64708014" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_1be2ca8d-7b19-4d84-98b7-05895c1daf0e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_64aa730e-18ea-4544-9fb0-29ef64708014" xlink:to="loc_us-gaap_AwardTypeAxis_1be2ca8d-7b19-4d84-98b7-05895c1daf0e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_1be2ca8d-7b19-4d84-98b7-05895c1daf0e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_1be2ca8d-7b19-4d84-98b7-05895c1daf0e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_1be2ca8d-7b19-4d84-98b7-05895c1daf0e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_77a2c49c-db03-40e5-80f8-9ebf206ca083" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_1be2ca8d-7b19-4d84-98b7-05895c1daf0e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_77a2c49c-db03-40e5-80f8-9ebf206ca083" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_a4c8b762-5e22-4d8d-a1ca-ba81197f937b" xlink:href="hsy-20221002.xsd#hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_77a2c49c-db03-40e5-80f8-9ebf206ca083" xlink:to="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_a4c8b762-5e22-4d8d-a1ca-ba81197f937b" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails" xlink:type="extended" id="i4af7936ccba246e1937e707d14e2a685_STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_9a08f04d-d245-4eb2-b32d-b07fe6b9fa4f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_ea7b3943-9ff3-408c-8e2b-ec46d9f48d46" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_9a08f04d-d245-4eb2-b32d-b07fe6b9fa4f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_ea7b3943-9ff3-408c-8e2b-ec46d9f48d46" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_a8061da7-86ab-49aa-ae24-c3e0693b5945" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_9a08f04d-d245-4eb2-b32d-b07fe6b9fa4f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_a8061da7-86ab-49aa-ae24-c3e0693b5945" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharePrice_aa9b99a5-a3c4-4628-b95f-e3d044458bd6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SharePrice"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_9a08f04d-d245-4eb2-b32d-b07fe6b9fa4f" xlink:to="loc_us-gaap_SharePrice_aa9b99a5-a3c4-4628-b95f-e3d044458bd6" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_1122f752-ee4f-4e4d-8443-7076b280e6a7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_9a08f04d-d245-4eb2-b32d-b07fe6b9fa4f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_1122f752-ee4f-4e4d-8443-7076b280e6a7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_fa41680e-78e2-4f78-a8b7-dfd519aed9c5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_9a08f04d-d245-4eb2-b32d-b07fe6b9fa4f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_fa41680e-78e2-4f78-a8b7-dfd519aed9c5" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_c1eb8ea2-9675-4a07-b21a-962ad2530642" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_9a08f04d-d245-4eb2-b32d-b07fe6b9fa4f" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_c1eb8ea2-9675-4a07-b21a-962ad2530642" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_4c0a43e9-785d-4ae0-90a4-cc2297fad398" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_c1eb8ea2-9675-4a07-b21a-962ad2530642" xlink:to="loc_us-gaap_AwardTypeAxis_4c0a43e9-785d-4ae0-90a4-cc2297fad398" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_4c0a43e9-785d-4ae0-90a4-cc2297fad398_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_4c0a43e9-785d-4ae0-90a4-cc2297fad398" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_4c0a43e9-785d-4ae0-90a4-cc2297fad398_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_73f81189-a4b7-47a8-94a6-8d611c35d19c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_4c0a43e9-785d-4ae0-90a4-cc2297fad398" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_73f81189-a4b7-47a8-94a6-8d611c35d19c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_d2dc931a-1fcc-467a-b815-3af2d9bb0da1" xlink:href="hsy-20221002.xsd#hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_73f81189-a4b7-47a8-94a6-8d611c35d19c" xlink:to="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_d2dc931a-1fcc-467a-b815-3af2d9bb0da1" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#SEGMENTINFORMATIONNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONNARRATIVEDetails" xlink:type="extended" id="idc2b2a384d124c91ac8c51c85938066b_SEGMENTINFORMATIONNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_a379a58c-eaf8-4bc0-97cb-de2f6abfcc82" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EntityWideRevenueMajorCustomerLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NumberOfReportableSegments_0ccd2870-03a4-41c1-953c-8f7142073858" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NumberOfReportableSegments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_a379a58c-eaf8-4bc0-97cb-de2f6abfcc82" xlink:to="loc_us-gaap_NumberOfReportableSegments_0ccd2870-03a4-41c1-953c-8f7142073858" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives_62fc20b5-d95f-4aa4-808b-819584ab1205" xlink:href="hsy-20221002.xsd#hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_a379a58c-eaf8-4bc0-97cb-de2f6abfcc82" xlink:to="loc_hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives_62fc20b5-d95f-4aa4-808b-819584ab1205" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_2b48c829-e805-4d6f-b5aa-08791ec6c15d" xlink:href="hsy-20221002.xsd#hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_a379a58c-eaf8-4bc0-97cb-de2f6abfcc82" xlink:to="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_2b48c829-e805-4d6f-b5aa-08791ec6c15d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_fa231e58-c1a7-4643-bddc-336ebec96e27" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_a379a58c-eaf8-4bc0-97cb-de2f6abfcc82" xlink:to="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_fa231e58-c1a7-4643-bddc-336ebec96e27" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationAxis_344d2b21-0223-474e-b332-e5bba42d7c10" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_fa231e58-c1a7-4643-bddc-336ebec96e27" xlink:to="loc_us-gaap_IncomeStatementLocationAxis_344d2b21-0223-474e-b332-e5bba42d7c10" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_344d2b21-0223-474e-b332-e5bba42d7c10_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_344d2b21-0223-474e-b332-e5bba42d7c10" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_344d2b21-0223-474e-b332-e5bba42d7c10_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_3f254d55-d850-4cda-a7a8-5981e4d78a1c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_344d2b21-0223-474e-b332-e5bba42d7c10" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_3f254d55-d850-4cda-a7a8-5981e4d78a1c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfSalesMember_b80f8e73-5857-4417-99b9-562927aff651" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CostOfSalesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_3f254d55-d850-4cda-a7a8-5981e4d78a1c" xlink:to="loc_us-gaap_CostOfSalesMember_b80f8e73-5857-4417-99b9-562927aff651" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementScenarioAxis_be939ebf-d44a-4735-b906-d3e1cd234040" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_StatementScenarioAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_fa231e58-c1a7-4643-bddc-336ebec96e27" xlink:to="loc_srt_StatementScenarioAxis_be939ebf-d44a-4735-b906-d3e1cd234040" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioUnspecifiedDomain_be939ebf-d44a-4735-b906-d3e1cd234040_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ScenarioUnspecifiedDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementScenarioAxis_be939ebf-d44a-4735-b906-d3e1cd234040" xlink:to="loc_srt_ScenarioUnspecifiedDomain_be939ebf-d44a-4735-b906-d3e1cd234040_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioUnspecifiedDomain_e2497cfb-5ad8-4f06-876b-6faecbc5b143" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ScenarioUnspecifiedDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementScenarioAxis_be939ebf-d44a-4735-b906-d3e1cd234040" xlink:to="loc_srt_ScenarioUnspecifiedDomain_e2497cfb-5ad8-4f06-876b-6faecbc5b143" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioForecastMember_080e2026-6166-49a3-be6f-82d4d24a2637" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ScenarioForecastMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ScenarioUnspecifiedDomain_e2497cfb-5ad8-4f06-876b-6faecbc5b143" xlink:to="loc_srt_ScenarioForecastMember_080e2026-6166-49a3-be6f-82d4d24a2637" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_5655b855-1621-48cb-801a-c52ba2678dc8" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_fa231e58-c1a7-4643-bddc-336ebec96e27" xlink:to="loc_srt_ConsolidationItemsAxis_5655b855-1621-48cb-801a-c52ba2678dc8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_5655b855-1621-48cb-801a-c52ba2678dc8_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_5655b855-1621-48cb-801a-c52ba2678dc8" xlink:to="loc_srt_ConsolidationItemsDomain_5655b855-1621-48cb-801a-c52ba2678dc8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_9722b790-9d3d-463c-a15b-9f911f88d78f" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_5655b855-1621-48cb-801a-c52ba2678dc8" xlink:to="loc_srt_ConsolidationItemsDomain_9722b790-9d3d-463c-a15b-9f911f88d78f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_86315a7a-d0ce-4e2e-a78a-8e4c33a89be5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_9722b790-9d3d-463c-a15b-9f911f88d78f" xlink:to="loc_us-gaap_OperatingSegmentsMember_86315a7a-d0ce-4e2e-a78a-8e4c33a89be5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_10b38ce0-87d2-4d3f-84b5-39cffd353eaf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_fa231e58-c1a7-4643-bddc-336ebec96e27" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_10b38ce0-87d2-4d3f-84b5-39cffd353eaf" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_10b38ce0-87d2-4d3f-84b5-39cffd353eaf_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_10b38ce0-87d2-4d3f-84b5-39cffd353eaf" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_10b38ce0-87d2-4d3f-84b5-39cffd353eaf_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_9c6730b9-7fcf-4286-8648-158ad3e67365" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_10b38ce0-87d2-4d3f-84b5-39cffd353eaf" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_9c6730b9-7fcf-4286-8648-158ad3e67365" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_08a54ce7-b5a5-4ab5-b558-46081b85eb62" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_9c6730b9-7fcf-4286-8648-158ad3e67365" xlink:to="loc_us-gaap_CommodityContractMember_08a54ce7-b5a5-4ab5-b558-46081b85eb62" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails" xlink:type="extended" id="ib967312de55d4961bd56fb648963258d_SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_33077e9d-0380-44f7-895d-8faa7e4447eb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentReportingInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_de7632ca-8183-4bbf-89c2-e8d600dcafb1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_33077e9d-0380-44f7-895d-8faa7e4447eb" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_de7632ca-8183-4bbf-89c2-e8d600dcafb1" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_817c831a-b356-4997-88b8-7696d86ea5b7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_33077e9d-0380-44f7-895d-8faa7e4447eb" xlink:to="loc_us-gaap_OperatingIncomeLoss_817c831a-b356-4997-88b8-7696d86ea5b7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpense_45832676-c9f4-410d-aa0d-f16720b0c32b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_33077e9d-0380-44f7-895d-8faa7e4447eb" xlink:to="loc_us-gaap_NonoperatingIncomeExpense_45832676-c9f4-410d-aa0d-f16720b0c32b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet_307c24d4-bc6d-44ee-8f5e-2f0bceefbdca" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_33077e9d-0380-44f7-895d-8faa7e4447eb" xlink:to="loc_us-gaap_DerivativeGainLossOnDerivativeNet_307c24d4-bc6d-44ee-8f5e-2f0bceefbdca" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_5948bc75-3fa1-4a6c-8279-50556cbeb13b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_33077e9d-0380-44f7-895d-8faa7e4447eb" xlink:to="loc_us-gaap_RestructuringCharges_5948bc75-3fa1-4a6c-8279-50556cbeb13b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_31727680-6bde-4a4b-b6cc-2f776a72ff3c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_InterestIncomeExpenseNonoperatingNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_33077e9d-0380-44f7-895d-8faa7e4447eb" xlink:to="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_31727680-6bde-4a4b-b6cc-2f776a72ff3c" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_9a703b91-0c11-4a6f-a0ac-fade7608095c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_33077e9d-0380-44f7-895d-8faa7e4447eb" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_9a703b91-0c11-4a6f-a0ac-fade7608095c" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_308c4317-2a7e-4023-8178-e5eeb3812036" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_33077e9d-0380-44f7-895d-8faa7e4447eb" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_308c4317-2a7e-4023-8178-e5eeb3812036" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_09f08c7f-1366-48fc-8aa1-9f0e7dda12ad" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_33077e9d-0380-44f7-895d-8faa7e4447eb" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_09f08c7f-1366-48fc-8aa1-9f0e7dda12ad" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_aef2941e-6db8-4c2d-845a-d70926eabc33" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_09f08c7f-1366-48fc-8aa1-9f0e7dda12ad" xlink:to="loc_srt_ConsolidationItemsAxis_aef2941e-6db8-4c2d-845a-d70926eabc33" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_aef2941e-6db8-4c2d-845a-d70926eabc33_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_aef2941e-6db8-4c2d-845a-d70926eabc33" xlink:to="loc_srt_ConsolidationItemsDomain_aef2941e-6db8-4c2d-845a-d70926eabc33_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_17885c6f-4372-44e7-b49d-2f7854fa97c2" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_aef2941e-6db8-4c2d-845a-d70926eabc33" xlink:to="loc_srt_ConsolidationItemsDomain_17885c6f-4372-44e7-b49d-2f7854fa97c2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_434b33fd-6766-4b2b-8747-46c849594398" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_17885c6f-4372-44e7-b49d-2f7854fa97c2" xlink:to="loc_us-gaap_OperatingSegmentsMember_434b33fd-6766-4b2b-8747-46c849594398" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateNonSegmentMember_3c5d0eb4-6055-4029-a9ea-8aafd70d8bf2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CorporateNonSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_17885c6f-4372-44e7-b49d-2f7854fa97c2" xlink:to="loc_us-gaap_CorporateNonSegmentMember_3c5d0eb4-6055-4029-a9ea-8aafd70d8bf2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MaterialReconcilingItemsMember_e5805f64-6c05-4b58-b292-a72117fd9c95" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_MaterialReconcilingItemsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_17885c6f-4372-44e7-b49d-2f7854fa97c2" xlink:to="loc_us-gaap_MaterialReconcilingItemsMember_e5805f64-6c05-4b58-b292-a72117fd9c95" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_6beaf08c-f591-4ff9-8071-e42d9ef41059" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_09f08c7f-1366-48fc-8aa1-9f0e7dda12ad" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_6beaf08c-f591-4ff9-8071-e42d9ef41059" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_6beaf08c-f591-4ff9-8071-e42d9ef41059_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_6beaf08c-f591-4ff9-8071-e42d9ef41059" xlink:to="loc_us-gaap_SegmentDomain_6beaf08c-f591-4ff9-8071-e42d9ef41059_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_cb2bec0c-39a1-4718-8ca9-43d9e66e760f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_6beaf08c-f591-4ff9-8071-e42d9ef41059" xlink:to="loc_us-gaap_SegmentDomain_cb2bec0c-39a1-4718-8ca9-43d9e66e760f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaConfectionerySegmentMember_b0de41c1-a73b-4487-bc33-191dacd1cd3b" xlink:href="hsy-20221002.xsd#hsy_NorthAmericaConfectionerySegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_cb2bec0c-39a1-4718-8ca9-43d9e66e760f" xlink:to="loc_hsy_NorthAmericaConfectionerySegmentMember_b0de41c1-a73b-4487-bc33-191dacd1cd3b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaSaltySnacksSegmentMember_c90316e0-6d9f-47de-a8b4-6663ac24fd04" xlink:href="hsy-20221002.xsd#hsy_NorthAmericaSaltySnacksSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_cb2bec0c-39a1-4718-8ca9-43d9e66e760f" xlink:to="loc_hsy_NorthAmericaSaltySnacksSegmentMember_c90316e0-6d9f-47de-a8b4-6663ac24fd04" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalSegmentMember_23bd0a74-2248-4a1d-8435-8e4c89b6d0b6" xlink:href="hsy-20221002.xsd#hsy_InternationalSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_cb2bec0c-39a1-4718-8ca9-43d9e66e760f" xlink:to="loc_hsy_InternationalSegmentMember_23bd0a74-2248-4a1d-8435-8e4c89b6d0b6" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails" xlink:type="extended" id="i7cc9ec9589db4b5f975662e53fb8d938_SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_c4fdd462-7109-45e1-8538-2385eee3cb11" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentReportingInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet_bb8442b1-358d-4162-a58a-52c6c044eb38" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_c4fdd462-7109-45e1-8538-2385eee3cb11" xlink:to="loc_us-gaap_DerivativeGainLossOnDerivativeNet_bb8442b1-358d-4162-a58a-52c6c044eb38" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_4245e5b2-a223-47b3-8875-5f3e92039b4a" xlink:href="hsy-20221002.xsd#hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_c4fdd462-7109-45e1-8538-2385eee3cb11" xlink:to="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_4245e5b2-a223-47b3-8875-5f3e92039b4a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NetMarktoMarketValuationofCertainDerivativePositionsRecognizedinUnallocatedDerivativeGainsLosses_4c31b6a6-7d97-48cb-aa0a-c1dc8e9f4fa1" xlink:href="hsy-20221002.xsd#hsy_NetMarktoMarketValuationofCertainDerivativePositionsRecognizedinUnallocatedDerivativeGainsLosses"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_c4fdd462-7109-45e1-8538-2385eee3cb11" xlink:to="loc_hsy_NetMarktoMarketValuationofCertainDerivativePositionsRecognizedinUnallocatedDerivativeGainsLosses_4c31b6a6-7d97-48cb-aa0a-c1dc8e9f4fa1" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_19853fda-dbf0-4ce2-b5af-dd1c0095c34f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_c4fdd462-7109-45e1-8538-2385eee3cb11" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_19853fda-dbf0-4ce2-b5af-dd1c0095c34f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_a3bf7bf7-bc20-4785-aed3-a2f22978c2e4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_19853fda-dbf0-4ce2-b5af-dd1c0095c34f" xlink:to="loc_us-gaap_HedgingDesignationAxis_a3bf7bf7-bc20-4785-aed3-a2f22978c2e4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_a3bf7bf7-bc20-4785-aed3-a2f22978c2e4_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_a3bf7bf7-bc20-4785-aed3-a2f22978c2e4" xlink:to="loc_us-gaap_HedgingDesignationDomain_a3bf7bf7-bc20-4785-aed3-a2f22978c2e4_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_892065c2-b792-4ecd-a027-6188b45c561b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_a3bf7bf7-bc20-4785-aed3-a2f22978c2e4" xlink:to="loc_us-gaap_HedgingDesignationDomain_892065c2-b792-4ecd-a027-6188b45c561b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_76f2e32a-8864-4b14-b788-c87954ab5322" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_892065c2-b792-4ecd-a027-6188b45c561b" xlink:to="loc_us-gaap_NondesignatedMember_76f2e32a-8864-4b14-b788-c87954ab5322" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_06d7573c-93c6-4c43-a4e7-646412f02f01" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_19853fda-dbf0-4ce2-b5af-dd1c0095c34f" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_06d7573c-93c6-4c43-a4e7-646412f02f01" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_06d7573c-93c6-4c43-a4e7-646412f02f01_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_06d7573c-93c6-4c43-a4e7-646412f02f01" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_06d7573c-93c6-4c43-a4e7-646412f02f01_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_5c6a4baa-c82d-4c5b-a019-a7880e457e9f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_06d7573c-93c6-4c43-a4e7-646412f02f01" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_5c6a4baa-c82d-4c5b-a019-a7880e457e9f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_cadd89c6-b4a8-4f1d-b20b-5c8eecef8d24" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_5c6a4baa-c82d-4c5b-a019-a7880e457e9f" xlink:to="loc_us-gaap_CommodityContractMember_cadd89c6-b4a8-4f1d-b20b-5c8eecef8d24" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_1a58d7d4-7294-4be2-b4d3-3ca469585cd3" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_19853fda-dbf0-4ce2-b5af-dd1c0095c34f" xlink:to="loc_srt_ConsolidationItemsAxis_1a58d7d4-7294-4be2-b4d3-3ca469585cd3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_1a58d7d4-7294-4be2-b4d3-3ca469585cd3_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_1a58d7d4-7294-4be2-b4d3-3ca469585cd3" xlink:to="loc_srt_ConsolidationItemsDomain_1a58d7d4-7294-4be2-b4d3-3ca469585cd3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_9e06186e-5c71-46b3-acb6-be168614e140" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_1a58d7d4-7294-4be2-b4d3-3ca469585cd3" xlink:to="loc_srt_ConsolidationItemsDomain_9e06186e-5c71-46b3-acb6-be168614e140" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_bde2cf9f-05a2-4b57-99c2-cdd2d99a5081" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_9e06186e-5c71-46b3-acb6-be168614e140" xlink:to="loc_us-gaap_OperatingSegmentsMember_bde2cf9f-05a2-4b57-99c2-cdd2d99a5081" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails" xlink:type="extended" id="ib46dc73030404709842084dfd24bb5f1_SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_dc06a8be-4c2f-43fc-87f7-5f1a3fcce340" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentReportingInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationDepletionAndAmortization_38cbeecc-ace9-4f74-ad40-139c7f33f76d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DepreciationDepletionAndAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_dc06a8be-4c2f-43fc-87f7-5f1a3fcce340" xlink:to="loc_us-gaap_DepreciationDepletionAndAmortization_38cbeecc-ace9-4f74-ad40-139c7f33f76d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_5d61531c-ec50-4a55-9959-ab2a9507108a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_dc06a8be-4c2f-43fc-87f7-5f1a3fcce340" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_5d61531c-ec50-4a55-9959-ab2a9507108a" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_b7cff4a1-18eb-403c-92e4-31df732ccada" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_5d61531c-ec50-4a55-9959-ab2a9507108a" xlink:to="loc_srt_ConsolidationItemsAxis_b7cff4a1-18eb-403c-92e4-31df732ccada" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_b7cff4a1-18eb-403c-92e4-31df732ccada_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_b7cff4a1-18eb-403c-92e4-31df732ccada" xlink:to="loc_srt_ConsolidationItemsDomain_b7cff4a1-18eb-403c-92e4-31df732ccada_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_9aba5392-3b63-474b-9c12-5ebb03142409" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_b7cff4a1-18eb-403c-92e4-31df732ccada" xlink:to="loc_srt_ConsolidationItemsDomain_9aba5392-3b63-474b-9c12-5ebb03142409" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_17132f75-0512-44f1-9b16-196df29cab01" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_9aba5392-3b63-474b-9c12-5ebb03142409" xlink:to="loc_us-gaap_OperatingSegmentsMember_17132f75-0512-44f1-9b16-196df29cab01" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateNonSegmentMember_c04db6ee-c343-48a8-8636-ffc074257c16" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CorporateNonSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_9aba5392-3b63-474b-9c12-5ebb03142409" xlink:to="loc_us-gaap_CorporateNonSegmentMember_c04db6ee-c343-48a8-8636-ffc074257c16" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_f57070d0-46d6-4715-97a4-99d6d945d58c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_5d61531c-ec50-4a55-9959-ab2a9507108a" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_f57070d0-46d6-4715-97a4-99d6d945d58c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_f57070d0-46d6-4715-97a4-99d6d945d58c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_f57070d0-46d6-4715-97a4-99d6d945d58c" xlink:to="loc_us-gaap_SegmentDomain_f57070d0-46d6-4715-97a4-99d6d945d58c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_9f560736-b542-48ad-b362-54c9270cb73b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_f57070d0-46d6-4715-97a4-99d6d945d58c" xlink:to="loc_us-gaap_SegmentDomain_9f560736-b542-48ad-b362-54c9270cb73b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaConfectionerySegmentMember_05b24c5b-25ef-4956-8000-5a462c6c7370" xlink:href="hsy-20221002.xsd#hsy_NorthAmericaConfectionerySegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_9f560736-b542-48ad-b362-54c9270cb73b" xlink:to="loc_hsy_NorthAmericaConfectionerySegmentMember_05b24c5b-25ef-4956-8000-5a462c6c7370" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaSaltySnacksSegmentMember_543b1097-4419-4f85-b58d-3196c9ee1f2c" xlink:href="hsy-20221002.xsd#hsy_NorthAmericaSaltySnacksSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_9f560736-b542-48ad-b362-54c9270cb73b" xlink:to="loc_hsy_NorthAmericaSaltySnacksSegmentMember_543b1097-4419-4f85-b58d-3196c9ee1f2c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalSegmentMember_a0f6d580-3baf-4799-b4dc-7885ad08f5b2" xlink:href="hsy-20221002.xsd#hsy_InternationalSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_9f560736-b542-48ad-b362-54c9270cb73b" xlink:to="loc_hsy_InternationalSegmentMember_a0f6d580-3baf-4799-b4dc-7885ad08f5b2" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateMember_20b3a94e-7ce5-417d-ab62-ed762d73db96" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CorporateMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_9f560736-b542-48ad-b362-54c9270cb73b" xlink:to="loc_us-gaap_CorporateMember_20b3a94e-7ce5-417d-ab62-ed762d73db96" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails" xlink:type="extended" id="i51da8fdffb1648a1828fc9dbb62183e8_SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_9cd2f8b1-2a3e-4409-8567-14c55b93f6ee" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EntityWideRevenueMajorCustomerLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_8c1c8318-bb89-4d43-98c4-794d6622281c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_9cd2f8b1-2a3e-4409-8567-14c55b93f6ee" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_8c1c8318-bb89-4d43-98c4-794d6622281c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_b9bce1a0-55ef-420c-b7f7-170502405858" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_9cd2f8b1-2a3e-4409-8567-14c55b93f6ee" xlink:to="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_b9bce1a0-55ef-420c-b7f7-170502405858" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementGeographicalAxis_ff3c9820-f698-4df4-86b4-6dd4e4e2cec1" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_StatementGeographicalAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_b9bce1a0-55ef-420c-b7f7-170502405858" xlink:to="loc_srt_StatementGeographicalAxis_ff3c9820-f698-4df4-86b4-6dd4e4e2cec1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_ff3c9820-f698-4df4-86b4-6dd4e4e2cec1_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_ff3c9820-f698-4df4-86b4-6dd4e4e2cec1" xlink:to="loc_srt_SegmentGeographicalDomain_ff3c9820-f698-4df4-86b4-6dd4e4e2cec1_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_80050b21-267c-4bab-81eb-a6a79d534e75" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_ff3c9820-f698-4df4-86b4-6dd4e4e2cec1" xlink:to="loc_srt_SegmentGeographicalDomain_80050b21-267c-4bab-81eb-a6a79d534e75" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_country_US_709f07db-ad60-42b1-9fe9-740a0af8aac2" xlink:href="https://xbrl.sec.gov/country/2022/country-2022.xsd#country_US"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_80050b21-267c-4bab-81eb-a6a79d534e75" xlink:to="loc_country_US_709f07db-ad60-42b1-9fe9-740a0af8aac2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonUsMember_05dad48a-d25c-4ce2-8a57-22e826270b07" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NonUsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_80050b21-267c-4bab-81eb-a6a79d534e75" xlink:to="loc_us-gaap_NonUsMember_05dad48a-d25c-4ce2-8a57-22e826270b07" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails" xlink:type="extended" id="i1243c206361b420886ee43706bc5c512_TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockLineItems_14bfc7f8-24ac-4eec-b790-0ca212d9c600" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockSharesAcquired_ee600ecd-079c-40d9-acb2-752575cef7d3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TreasuryStockSharesAcquired"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_14bfc7f8-24ac-4eec-b790-0ca212d9c600" xlink:to="loc_us-gaap_TreasuryStockSharesAcquired_ee600ecd-079c-40d9-acb2-752575cef7d3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross_24fdba0f-8b4b-4374-8f49-0cee6e21cc2d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_14bfc7f8-24ac-4eec-b790-0ca212d9c600" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross_24fdba0f-8b4b-4374-8f49-0cee6e21cc2d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockChangeinShares_16e464de-2f23-4c65-a8b5-8274b0a72016" xlink:href="hsy-20221002.xsd#hsy_TreasuryStockChangeinShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_14bfc7f8-24ac-4eec-b790-0ca212d9c600" xlink:to="loc_hsy_TreasuryStockChangeinShares_16e464de-2f23-4c65-a8b5-8274b0a72016" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodValue_c1596926-ae9c-40fb-a344-7da5ed0b7161" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockRepurchasedDuringPeriodValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_14bfc7f8-24ac-4eec-b790-0ca212d9c600" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodValue_c1596926-ae9c-40fb-a344-7da5ed0b7161" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross_8af73750-1777-4737-9ace-0d5fa9aaac2f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_14bfc7f8-24ac-4eec-b790-0ca212d9c600" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross_8af73750-1777-4737-9ace-0d5fa9aaac2f" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockChangeinValue_0e7504ac-bdd8-4cb7-8268-8d3c0077c920" xlink:href="hsy-20221002.xsd#hsy_TreasuryStockChangeinValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_14bfc7f8-24ac-4eec-b790-0ca212d9c600" xlink:to="loc_hsy_TreasuryStockChangeinValue_0e7504ac-bdd8-4cb7-8268-8d3c0077c920" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfStockByClassTable_9b9cbf0e-22a9-4af3-b673-36b0b005d67e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfStockByClassTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ClassOfStockLineItems_14bfc7f8-24ac-4eec-b790-0ca212d9c600" xlink:to="loc_us-gaap_ScheduleOfStockByClassTable_9b9cbf0e-22a9-4af3-b673-36b0b005d67e" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_4c7e0368-e06c-48d3-84e7-36b42dba6bce" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfStockByClassTable_9b9cbf0e-22a9-4af3-b673-36b0b005d67e" xlink:to="loc_us-gaap_StatementClassOfStockAxis_4c7e0368-e06c-48d3-84e7-36b42dba6bce" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_4c7e0368-e06c-48d3-84e7-36b42dba6bce_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_4c7e0368-e06c-48d3-84e7-36b42dba6bce" xlink:to="loc_us-gaap_ClassOfStockDomain_4c7e0368-e06c-48d3-84e7-36b42dba6bce_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_7864bfce-60bf-4d55-8391-f9bd702f0a13" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_4c7e0368-e06c-48d3-84e7-36b42dba6bce" xlink:to="loc_us-gaap_ClassOfStockDomain_7864bfce-60bf-4d55-8391-f9bd702f0a13" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyCommonStockMember_e7d01f19-a8e9-4e33-9310-9c22d9a11db4" xlink:href="hsy-20221002.xsd#hsy_HersheyCommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_7864bfce-60bf-4d55-8391-f9bd702f0a13" xlink:to="loc_hsy_HersheyCommonStockMember_e7d01f19-a8e9-4e33-9310-9c22d9a11db4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_cc2a9acd-a65d-4341-9d54-20c110c32ecb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfStockByClassTable_9b9cbf0e-22a9-4af3-b673-36b0b005d67e" xlink:to="loc_us-gaap_AwardTypeAxis_cc2a9acd-a65d-4341-9d54-20c110c32ecb" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_cc2a9acd-a65d-4341-9d54-20c110c32ecb_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_cc2a9acd-a65d-4341-9d54-20c110c32ecb" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_cc2a9acd-a65d-4341-9d54-20c110c32ecb_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_283a8ea3-3c56-4457-8682-7825f47ce7c5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_cc2a9acd-a65d-4341-9d54-20c110c32ecb" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_283a8ea3-3c56-4457-8682-7825f47ce7c5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyTrustCompanyMember_7bb6a7ef-1c82-4f39-89b3-bd2147bfd09e" xlink:href="hsy-20221002.xsd#hsy_HersheyTrustCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_283a8ea3-3c56-4457-8682-7825f47ce7c5" xlink:to="loc_hsy_HersheyTrustCompanyMember_7bb6a7ef-1c82-4f39-89b3-bd2147bfd09e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_b9073939-e2fe-4051-9a60-f685804cc6b5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_283a8ea3-3c56-4457-8682-7825f47ce7c5" xlink:to="loc_us-gaap_EmployeeStockOptionMember_b9073939-e2fe-4051-9a60-f685804cc6b5" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#TREASURYSTOCKACTIVITYNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYNARRATIVEDetails" xlink:type="extended" id="i0cd7d4e8d1194a9f8fb2dd9c3afa0114_TREASURYSTOCKACTIVITYNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityClassOfTreasuryStockLineItems_08c2a544-2f3d-4a0f-aa18-e2ec893ad2a7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EquityClassOfTreasuryStockLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockSharesAcquired_6a55118a-eaaa-4184-8401-10dfd9159975" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TreasuryStockSharesAcquired"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_08c2a544-2f3d-4a0f-aa18-e2ec893ad2a7" xlink:to="loc_us-gaap_TreasuryStockSharesAcquired_6a55118a-eaaa-4184-8401-10dfd9159975" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockAcquiredAverageCostPerShare_8f72425c-3bd2-4b52-a67a-18eeff45c538" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TreasuryStockAcquiredAverageCostPerShare"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_08c2a544-2f3d-4a0f-aa18-e2ec893ad2a7" xlink:to="loc_us-gaap_TreasuryStockAcquiredAverageCostPerShare_8f72425c-3bd2-4b52-a67a-18eeff45c538" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodValue_2b0440f9-00dc-4e79-8d57-f1447fda41c0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockRepurchasedDuringPeriodValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_08c2a544-2f3d-4a0f-aa18-e2ec893ad2a7" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodValue_2b0440f9-00dc-4e79-8d57-f1447fda41c0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchaseProgramAuthorizedAmount1_4520caed-e198-4adc-a806-bd1f6adb3218" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockRepurchaseProgramAuthorizedAmount1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_08c2a544-2f3d-4a0f-aa18-e2ec893ad2a7" xlink:to="loc_us-gaap_StockRepurchaseProgramAuthorizedAmount1_4520caed-e198-4adc-a806-bd1f6adb3218" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1_308f039e-938c-4109-9620-bfa1b630aa36" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_08c2a544-2f3d-4a0f-aa18-e2ec893ad2a7" xlink:to="loc_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1_308f039e-938c-4109-9620-bfa1b630aa36" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfTreasuryStockTable_688afdaa-6f0a-40b2-a093-5be1e219233c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfTreasuryStockTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_08c2a544-2f3d-4a0f-aa18-e2ec893ad2a7" xlink:to="loc_us-gaap_ClassOfTreasuryStockTable_688afdaa-6f0a-40b2-a093-5be1e219233c" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_0c4d0423-9dd1-471d-abb6-e31dbecf7846" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfTreasuryStockTable_688afdaa-6f0a-40b2-a093-5be1e219233c" xlink:to="loc_us-gaap_AwardTypeAxis_0c4d0423-9dd1-471d-abb6-e31dbecf7846" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_0c4d0423-9dd1-471d-abb6-e31dbecf7846_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_0c4d0423-9dd1-471d-abb6-e31dbecf7846" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_0c4d0423-9dd1-471d-abb6-e31dbecf7846_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_c943c284-5784-417a-b212-455a690a6337" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_0c4d0423-9dd1-471d-abb6-e31dbecf7846" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_c943c284-5784-417a-b212-455a690a6337" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyTrustCompanyMember_7d0a16e3-b80a-4144-b86c-bddf380831b9" xlink:href="hsy-20221002.xsd#hsy_HersheyTrustCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_c943c284-5784-417a-b212-455a690a6337" xlink:to="loc_hsy_HersheyTrustCompanyMember_7d0a16e3-b80a-4144-b86c-bddf380831b9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramAxis_14e12b49-c8d9-40f4-8827-a1decd7b8085" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareRepurchaseProgramAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfTreasuryStockTable_688afdaa-6f0a-40b2-a093-5be1e219233c" xlink:to="loc_us-gaap_ShareRepurchaseProgramAxis_14e12b49-c8d9-40f4-8827-a1decd7b8085" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramDomain_14e12b49-c8d9-40f4-8827-a1decd7b8085_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareRepurchaseProgramDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShareRepurchaseProgramAxis_14e12b49-c8d9-40f4-8827-a1decd7b8085" xlink:to="loc_us-gaap_ShareRepurchaseProgramDomain_14e12b49-c8d9-40f4-8827-a1decd7b8085_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramDomain_aa8612fd-0146-4331-9aed-a36b7bb16657" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareRepurchaseProgramDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShareRepurchaseProgramAxis_14e12b49-c8d9-40f4-8827-a1decd7b8085" xlink:to="loc_us-gaap_ShareRepurchaseProgramDomain_aa8612fd-0146-4331-9aed-a36b7bb16657" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_A2018ShareRepurchaseProgramMember_7763e16e-fa26-4292-b289-ba172c76ff2e" xlink:href="hsy-20221002.xsd#hsy_A2018ShareRepurchaseProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareRepurchaseProgramDomain_aa8612fd-0146-4331-9aed-a36b7bb16657" xlink:to="loc_hsy_A2018ShareRepurchaseProgramMember_7763e16e-fa26-4292-b289-ba172c76ff2e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_A2021ShareRepurchaseProgramMember_df4512da-f77c-419c-b293-e3fc4d231f94" xlink:href="hsy-20221002.xsd#hsy_A2021ShareRepurchaseProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareRepurchaseProgramDomain_aa8612fd-0146-4331-9aed-a36b7bb16657" xlink:to="loc_hsy_A2021ShareRepurchaseProgramMember_df4512da-f77c-419c-b293-e3fc4d231f94" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/EARNINGSPERSHARENARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#EARNINGSPERSHARENARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/EARNINGSPERSHARENARRATIVEDetails" xlink:type="extended" id="i55e8fcb79ab841a58ded1f79f1e3e115_EARNINGSPERSHARENARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_0f41dff9-8a97-47bc-8da5-82d115562c1b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConversionOfStockSharesConverted1_291c20b2-7719-472f-9b15-d1928a4253e8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ConversionOfStockSharesConverted1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_0f41dff9-8a97-47bc-8da5-82d115562c1b" xlink:to="loc_us-gaap_ConversionOfStockSharesConverted1_291c20b2-7719-472f-9b15-d1928a4253e8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_232129a6-16ec-4914-ad84-67e282c3c744" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_0f41dff9-8a97-47bc-8da5-82d115562c1b" xlink:to="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_232129a6-16ec-4914-ad84-67e282c3c744" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_0fde6aef-4610-4698-82ef-e531a458cc57" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_0f41dff9-8a97-47bc-8da5-82d115562c1b" xlink:to="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_0fde6aef-4610-4698-82ef-e531a458cc57" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_CounterpartyNameAxis_479cc665-2896-4bd3-94ba-631d87337d66" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_CounterpartyNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_0fde6aef-4610-4698-82ef-e531a458cc57" xlink:to="loc_srt_CounterpartyNameAxis_479cc665-2896-4bd3-94ba-631d87337d66" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_479cc665-2896-4bd3-94ba-631d87337d66_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RepurchaseAgreementCounterpartyNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_CounterpartyNameAxis_479cc665-2896-4bd3-94ba-631d87337d66" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_479cc665-2896-4bd3-94ba-631d87337d66_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_695a6116-e3a6-4149-8de1-61ef624ac4b4" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RepurchaseAgreementCounterpartyNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_CounterpartyNameAxis_479cc665-2896-4bd3-94ba-631d87337d66" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_695a6116-e3a6-4149-8de1-61ef624ac4b4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyTrustCompanyMember_0e533faf-7f5d-43f3-978e-77a2cb289a41" xlink:href="hsy-20221002.xsd#hsy_HersheyTrustCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RepurchaseAgreementCounterpartyNameDomain_695a6116-e3a6-4149-8de1-61ef624ac4b4" xlink:to="loc_hsy_HersheyTrustCompanyMember_0e533faf-7f5d-43f3-978e-77a2cb289a41" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_a12c5ab7-6a47-47e0-9ad2-e41c5dc7c775" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_0fde6aef-4610-4698-82ef-e531a458cc57" xlink:to="loc_us-gaap_StatementClassOfStockAxis_a12c5ab7-6a47-47e0-9ad2-e41c5dc7c775" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_a12c5ab7-6a47-47e0-9ad2-e41c5dc7c775_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_a12c5ab7-6a47-47e0-9ad2-e41c5dc7c775" xlink:to="loc_us-gaap_ClassOfStockDomain_a12c5ab7-6a47-47e0-9ad2-e41c5dc7c775_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_f24c61c6-77d4-4ed0-a24c-e2e2c9c0dc76" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_a12c5ab7-6a47-47e0-9ad2-e41c5dc7c775" xlink:to="loc_us-gaap_ClassOfStockDomain_f24c61c6-77d4-4ed0-a24c-e2e2c9c0dc76" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_51410ccd-3773-459f-93f0-74db57f7d221" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_f24c61c6-77d4-4ed0-a24c-e2e2c9c0dc76" xlink:to="loc_us-gaap_CommonClassBMember_51410ccd-3773-459f-93f0-74db57f7d221" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_71996e0e-c74c-4cff-b479-dcd0a566ecf8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_0fde6aef-4610-4698-82ef-e531a458cc57" xlink:to="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_71996e0e-c74c-4cff-b479-dcd0a566ecf8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain_71996e0e-c74c-4cff-b479-dcd0a566ecf8_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_71996e0e-c74c-4cff-b479-dcd0a566ecf8" xlink:to="loc_us-gaap_AntidilutiveSecuritiesNameDomain_71996e0e-c74c-4cff-b479-dcd0a566ecf8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain_c1c57a53-2dde-4d66-8be6-276ab4e8b0ad" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_71996e0e-c74c-4cff-b479-dcd0a566ecf8" xlink:to="loc_us-gaap_AntidilutiveSecuritiesNameDomain_c1c57a53-2dde-4d66-8be6-276ab4e8b0ad" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_f253e772-0559-4159-a650-cb0022e34d01" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesNameDomain_c1c57a53-2dde-4d66-8be6-276ab4e8b0ad" xlink:to="loc_us-gaap_EmployeeStockOptionMember_f253e772-0559-4159-a650-cb0022e34d01" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails" xlink:type="extended" id="i380eb2e4a09d46548095bd6f4f346b4b_EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicLineItems_244987ad-92de-420b-8b9d-098514f9401f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EarningsPerShareBasicLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_b28615ca-631c-4c63-adbd-f7c43d021a62" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EarningsPerShareBasicTwoClassMethodAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_244987ad-92de-420b-8b9d-098514f9401f" xlink:to="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_b28615ca-631c-4c63-adbd-f7c43d021a62" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Dividends_73df6de4-2e46-4ef8-b01e-79c236438be5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Dividends"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_b28615ca-631c-4c63-adbd-f7c43d021a62" xlink:to="loc_us-gaap_Dividends_73df6de4-2e46-4ef8-b01e-79c236438be5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic_c5804da0-9bd5-4e37-a066-37c5fa574aa3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_b28615ca-631c-4c63-adbd-f7c43d021a62" xlink:to="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic_c5804da0-9bd5-4e37-a066-37c5fa574aa3" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic_392fab78-f8c7-411d-9414-1f70010ddac9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_b28615ca-631c-4c63-adbd-f7c43d021a62" xlink:to="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic_392fab78-f8c7-411d-9414-1f70010ddac9" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_8718e61b-b81a-40b8-a034-1b6715f832c3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_b28615ca-631c-4c63-adbd-f7c43d021a62" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_8718e61b-b81a-40b8-a034-1b6715f832c3" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasic_f4ac4e24-8fd1-4a84-b8a4-8d7980c27548" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EarningsPerShareBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_b28615ca-631c-4c63-adbd-f7c43d021a62" xlink:to="loc_us-gaap_EarningsPerShareBasic_f4ac4e24-8fd1-4a84-b8a4-8d7980c27548" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_72c273f1-0cb9-46ea-adcd-70da13b43d8d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_244987ad-92de-420b-8b9d-098514f9401f" xlink:to="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_72c273f1-0cb9-46ea-adcd-70da13b43d8d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DistributedEarnings_a62a7875-20fe-4ea2-96ee-a918cdd8b7fd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DistributedEarnings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_72c273f1-0cb9-46ea-adcd-70da13b43d8d" xlink:to="loc_us-gaap_DistributedEarnings_a62a7875-20fe-4ea2-96ee-a918cdd8b7fd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesDiluted_56005f67-840f-4776-89a5-fc5a1da9391c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_72c273f1-0cb9-46ea-adcd-70da13b43d8d" xlink:to="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesDiluted_56005f67-840f-4776-89a5-fc5a1da9391c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossDiluted_08a3c424-0e4e-420c-82af-78a9a5d369bb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_72c273f1-0cb9-46ea-adcd-70da13b43d8d" xlink:to="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossDiluted_08a3c424-0e4e-420c-82af-78a9a5d369bb" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_IncrementalCommonSharesAttributabletoDilutiveEffectofConversionofCommonStock_b7dd19a8-a4d3-4dbe-be90-84f395e33f43" xlink:href="hsy-20221002.xsd#hsy_IncrementalCommonSharesAttributabletoDilutiveEffectofConversionofCommonStock"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_72c273f1-0cb9-46ea-adcd-70da13b43d8d" xlink:to="loc_hsy_IncrementalCommonSharesAttributabletoDilutiveEffectofConversionofCommonStock_b7dd19a8-a4d3-4dbe-be90-84f395e33f43" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_d07c6304-8e22-47b4-afc1-ff2ea692ce5b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_72c273f1-0cb9-46ea-adcd-70da13b43d8d" xlink:to="loc_us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_d07c6304-8e22-47b4-afc1-ff2ea692ce5b" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_4cf93d49-8194-4e7e-ac93-61231be2834d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_72c273f1-0cb9-46ea-adcd-70da13b43d8d" xlink:to="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_4cf93d49-8194-4e7e-ac93-61231be2834d" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDiluted_3dd8bdbb-6618-4746-a356-2fabe80a3de6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EarningsPerShareDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_72c273f1-0cb9-46ea-adcd-70da13b43d8d" xlink:to="loc_us-gaap_EarningsPerShareDiluted_3dd8bdbb-6618-4746-a356-2fabe80a3de6" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_4464a8ee-2619-4d55-9164-1ce8411892e8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_244987ad-92de-420b-8b9d-098514f9401f" xlink:to="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_4464a8ee-2619-4d55-9164-1ce8411892e8" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_30d3d5fe-d1c3-46c6-9314-054f33ac80e0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_4464a8ee-2619-4d55-9164-1ce8411892e8" xlink:to="loc_us-gaap_StatementClassOfStockAxis_30d3d5fe-d1c3-46c6-9314-054f33ac80e0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_30d3d5fe-d1c3-46c6-9314-054f33ac80e0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_30d3d5fe-d1c3-46c6-9314-054f33ac80e0" xlink:to="loc_us-gaap_ClassOfStockDomain_30d3d5fe-d1c3-46c6-9314-054f33ac80e0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_719e7054-dcf6-4d0d-bab7-1013cc37cc67" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_30d3d5fe-d1c3-46c6-9314-054f33ac80e0" xlink:to="loc_us-gaap_ClassOfStockDomain_719e7054-dcf6-4d0d-bab7-1013cc37cc67" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_fcb7eaa7-314b-4b91-aea9-282e03fc3639" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_719e7054-dcf6-4d0d-bab7-1013cc37cc67" xlink:to="loc_us-gaap_CommonStockMember_fcb7eaa7-314b-4b91-aea9-282e03fc3639" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_fa416e5e-2575-48c6-bb13-4c6d9669b078" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_719e7054-dcf6-4d0d-bab7-1013cc37cc67" xlink:to="loc_us-gaap_CommonClassBMember_fa416e5e-2575-48c6-bb13-4c6d9669b078" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_1b896e22-d837-4267-8d60-f57576ad1a91" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_4464a8ee-2619-4d55-9164-1ce8411892e8" xlink:to="loc_us-gaap_AwardTypeAxis_1b896e22-d837-4267-8d60-f57576ad1a91" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_1b896e22-d837-4267-8d60-f57576ad1a91_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_1b896e22-d837-4267-8d60-f57576ad1a91" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_1b896e22-d837-4267-8d60-f57576ad1a91_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_322106e8-7b4d-4d11-b3be-096ccdb9e365" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_1b896e22-d837-4267-8d60-f57576ad1a91" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_322106e8-7b4d-4d11-b3be-096ccdb9e365" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_91ad5128-8677-4e2e-afc3-dc03ee7a0419" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_322106e8-7b4d-4d11-b3be-096ccdb9e365" xlink:to="loc_us-gaap_EmployeeStockOptionMember_91ad5128-8677-4e2e-afc3-dc03ee7a0419" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_a02f289d-647d-446a-a2d8-99803d22eb7d" xlink:href="hsy-20221002.xsd#hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_322106e8-7b4d-4d11-b3be-096ccdb9e365" xlink:to="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_a02f289d-647d-446a-a2d8-99803d22eb7d" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/RELATEDPARTYTRANSACTIONSDetails" xlink:type="simple" xlink:href="hsy-20221002.xsd#RELATEDPARTYTRANSACTIONSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/RELATEDPARTYTRANSACTIONSDetails" xlink:type="extended" id="i3243e5f030ff416dad87f961a0d0bf9a_RELATEDPARTYTRANSACTIONSDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionLineItems_883b1896-3b49-428e-8352-20de62e190ad" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RelatedPartyTransactionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AreaOfLand_2039272b-4038-4575-92a2-a23152eb2f7a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AreaOfLand"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyTransactionLineItems_883b1896-3b49-428e-8352-20de62e190ad" xlink:to="loc_us-gaap_AreaOfLand_2039272b-4038-4575-92a2-a23152eb2f7a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment_96e2342a-9237-4ae3-9d84-3139ba24063b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyTransactionLineItems_883b1896-3b49-428e-8352-20de62e190ad" xlink:to="loc_us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment_96e2342a-9237-4ae3-9d84-3139ba24063b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnSaleOfProperties_f9d295e4-365d-4f2c-b195-02629c8abcc3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GainLossOnSaleOfProperties"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyTransactionLineItems_883b1896-3b49-428e-8352-20de62e190ad" xlink:to="loc_us-gaap_GainLossOnSaleOfProperties_f9d295e4-365d-4f2c-b195-02629c8abcc3" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_553783b2-fe50-49d2-b339-b38874a64219" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RelatedPartyTransactionLineItems_883b1896-3b49-428e-8352-20de62e190ad" xlink:to="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_553783b2-fe50-49d2-b339-b38874a64219" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_ddf9c835-a549-4085-9469-1c547a9ef9e0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RelatedPartyTransactionsByRelatedPartyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_553783b2-fe50-49d2-b339-b38874a64219" xlink:to="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_ddf9c835-a549-4085-9469-1c547a9ef9e0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyDomain_ddf9c835-a549-4085-9469-1c547a9ef9e0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RelatedPartyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_ddf9c835-a549-4085-9469-1c547a9ef9e0" xlink:to="loc_us-gaap_RelatedPartyDomain_ddf9c835-a549-4085-9469-1c547a9ef9e0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyDomain_16a62d2b-aacc-47e3-9b60-5e6ae2ef6ea2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RelatedPartyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_ddf9c835-a549-4085-9469-1c547a9ef9e0" xlink:to="loc_us-gaap_RelatedPartyDomain_16a62d2b-aacc-47e3-9b60-5e6ae2ef6ea2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyTrustCompanyMember_6e68c22f-776b-4678-ad11-fb99aaeac59d" xlink:href="hsy-20221002.xsd#hsy_HersheyTrustCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyDomain_16a62d2b-aacc-47e3-9b60-5e6ae2ef6ea2" xlink:to="loc_hsy_HersheyTrustCompanyMember_6e68c22f-776b-4678-ad11-fb99aaeac59d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionAxis_1d641f42-cdab-4d1f-b985-b740aea33808" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RelatedPartyTransactionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_553783b2-fe50-49d2-b339-b38874a64219" xlink:to="loc_us-gaap_RelatedPartyTransactionAxis_1d641f42-cdab-4d1f-b985-b740aea33808" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionDomain_1d641f42-cdab-4d1f-b985-b740aea33808_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RelatedPartyTransactionDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RelatedPartyTransactionAxis_1d641f42-cdab-4d1f-b985-b740aea33808" xlink:to="loc_us-gaap_RelatedPartyTransactionDomain_1d641f42-cdab-4d1f-b985-b740aea33808_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionDomain_7128bff4-57b0-44bc-a1ae-f70653e83f43" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RelatedPartyTransactionDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RelatedPartyTransactionAxis_1d641f42-cdab-4d1f-b985-b740aea33808" xlink:to="loc_us-gaap_RelatedPartyTransactionDomain_7128bff4-57b0-44bc-a1ae-f70653e83f43" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DonationAgreementMember_a45228e1-994b-4d24-8b56-e6795a037528" xlink:href="hsy-20221002.xsd#hsy_DonationAgreementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyTransactionDomain_7128bff4-57b0-44bc-a1ae-f70653e83f43" xlink:to="loc_hsy_DonationAgreementMember_a45228e1-994b-4d24-8b56-e6795a037528" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://fasb.org/us-gaap/role/eedm/ExtensibleEnumerationLists" xlink:type="simple" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-roles-2022.xsd#eedm"/>
  <link:definitionLink xlink:role="http://fasb.org/us-gaap/role/eedm/ExtensibleEnumerationLists" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrentAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesCurrentAbstract"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrent" xlink:type="arc" order="0"/>
  </link:definitionLink>
</link:linkbase>
