Exhibit 23
Consent of Independent Registered Public Accounting Firm
We consent to the incorporation by reference in Registration Statement (No. 333-277445 and 333-264788) on Form S-8 of C&F Financial Corporation of our report dated June 17, 2026, relating to our audit of the financial statements and supplemental schedule of the SBA Defined Contribution Plan for Citizens and Farmers Bank (the Plan), which appears in this Annual Report on Form 11-K of the Plan for the year ended December 31, 2025.
/s/ Yount, Hyde & Barbour, P.C.
Roanoke, Virginia
June 17, 2026