Exhibit 23

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

We hereby consent to the incorporation by reference in the Registration Statements on Form S-3 (Nos. 333-268396, 333-264326, and 333-239156) and Form S-8 (Nos. 333-258896, 333-239213, 333-230139, 333-223535, 333-216492, 333-202709, 333-194634, 333-187206, 333-237195, 333-209998, 333-180334, and 333‑172409) of AcelRx Pharmaceuticals, Inc. of our report dated March 31, 2023, except for the effects of the discontinued operations disclosed in Note 3, as to which the date is July 31, 2023, which includes an explanatory paragraph relating to AcelRx Pharmaceuticals, Inc.’s ability to continue as a going concern, relating to the consolidated financial statements and schedule II, which appears in this Current Report on Form 8‑K.

/s/ WithumSmith+Brown, PC

San Francisco, California

July 31, 2023