My experience is that it is almost impossible to use PRE tags in WordPress.
In the Post editor there is a “CODE” tab you can click on to to enable a “CODE” editor which lets you insert HTML tags. It’s here that you can insert the PRE tag.
The second you save the code it returns you to the GUI editor which then collapses all your spaces. This makes indentation in your code impossible to achieve. Every single line inside a loop, an if statment, etc.. all start in column one.
In my opinion WordPress has become impossible to use for people who want to write and share code snippets.