Short answer: No.
Long answer: Laptop motherboards are specifically designed to fit within a specific laptop body. Even if you find a motherboard where the power, USB, HDMI, etc. ports line up AND all the screw holes line up as well, HP uses "white lists" that only allow specific hardware to be used with the motherboard.
However! HP also likes to reuse their laptop bodies for various price/performance classes. If you can find a higher-tier motherboard that will fit your laptop's body, you might be able to fix it the way you are proposing. Please bear in mind that laptop CPUs tend to be stupidly priced (considerably more expensive than desktop CPUs) and the "white list" issue may require you to also buy a different WiFi card and possibly a new screen too. If you have a dedicated GPU, you are pretty much guaranteed to be screwed.