You need to restore the original factory defaults via the Embedded Web Server.
- Open the Embedded Web Server (EWS). Connect a computer to the same network as the printer, then type the printer's IP address into a web browser. Find the IP on a printed network configuration page.
- Log in. Username is 'admin'. The password is printed on the label inside the cartridge access door.
- Click the System tab, then click Service.
- In the Restore Defaults area, click the Restore defaults button. The printer will restart automatically.
This resets all settings, including network configurations. For a network-only reset, use the hardware method: press and hold the Information button for 3 seconds, then press and hold the Wireless and Cancel buttons together. This restores only network settings to default.
Heads up: After the full factory reset, the new owner will need to set up the printer from scratch, including Wi-Fi connection via the HP Smart app.