This guide will walk you through the steps to connect your printer to a new wireless router after replacing or upgrading your old router.
Connect an HP printer to a wireless network using Wi-Fi Protected Setup | HP Support
When you change your router, your Wi-Fi network will change too. It may be faster, operate on new frequencies (such as 5GHz), and will undoubtedly have a new SSID. This means that if you want to keep your printer connected to a wireless network, you will need to reconnect it.
If your new router’s wireless network isn’t working, check to make sure it’s working. Then, write down the Wi-Fi password your new router uses to secure your network.
Turn on your printer and use the control panel to find the network settings menu. This process varies by printer. Some have physical buttons and a display, others have a touchscreen, and still others have an application on your phone. Consult the manufacturer's website or manual for specific instructions by model.