How to disconnect(dissolve) edge between vertices

Is there a simple way to disconnect or dissolve edges in between vertices while keeping the vertices so that it would end up like the image below?
I tried everything I could think of, but the corner squares would always end up being triangles.
I eventually got the desired outcome, but just by chance (first beveling+indenting the corners and then deleting the marked edges).
But I am still curious if this is something possible. Just feels better cleaning up beforehand than afterwards..!!