<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2026-02-23</periodOfReport>

    <issuer>
        <issuerCik>0000077360</issuerCik>
        <issuerName>PENTAIR plc</issuerName>
        <issuerTradingSymbol>PNR</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0002068707</rptOwnerCik>
            <rptOwnerName>Hensley Jennifer M</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>5500 WAYZATA BOULEVARD</rptOwnerStreet1>
            <rptOwnerStreet2>SUITE 900</rptOwnerStreet2>
            <rptOwnerCity>GOLDEN VALLEY</rptOwnerCity>
            <rptOwnerState>MN</rptOwnerState>
            <rptOwnerZipCode>55416</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>false</isDirector>
            <isOfficer>true</isOfficer>
            <isTenPercentOwner>false</isTenPercentOwner>
            <isOther>false</isOther>
            <officerTitle>SVP, CAO &amp; Controller</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>false</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Shares</value>
            </securityTitle>
            <transactionDate>
                <value>2026-02-23</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>false</equitySwapInvolved>
                <footnoteId id="F1"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>997</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>2707.7285</value>
                    <footnoteId id="F2"/>
                    <footnoteId id="F3"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Shares</value>
            </securityTitle>
            <transactionDate>
                <value>2026-02-23</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>F</transactionCode>
                <equitySwapInvolved>false</equitySwapInvolved>
                <footnoteId id="F4"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>399</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>101.66</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>2308.7285</value>
                    <footnoteId id="F2"/>
                    <footnoteId id="F3"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Shares - Restricted Stock Units</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>3680.9400</value>
                    <footnoteId id="F3"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Shares - ESOP</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>271.0080</value>
                    <footnoteId id="F3"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>Plan Agent</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Reflects the settlement of performance share units in shares earned for the performance period ended December 31, 2025. The Compensation Committee certified the achievement of the performance goals on February 23, 2026.</footnote>
        <footnote id="F2">End-of-period holdings include monthly purchases under the ESPP in exempt transactions pursuant to Rule 16b-3(c).</footnote>
        <footnote id="F3">End-of-period holdings include shares acquired under a dividend reinvestment plan in exempt transactions not required to be reported pursuant to Section 16(a).</footnote>
        <footnote id="F4">Shares surrendered to pay taxes applicable to settlement of performance share units.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ John K. Wilson, Attorney-in-Fact for Jennifer M. Hensley</signatureName>
        <signatureDate>2026-02-25</signatureDate>
    </ownerSignature>
</ownershipDocument>
