Yes, that looks ok, but you don’t use a dedicated controller for the contact form, you would have to merge the data into this site controller as well. Not so sure this makes sense.
So I’ve deleted all content of the /controllers/contact.php, and added that code to my /controllers/site.php, and I am getting “compact(): Undefined variable: site”
(I am trying to read through and understand what is going on and see if I can do anything myself before asking you, sorry to keep having to ask you to solve everything for me )
Controllers should match the template name. If the controller is for pages using blog.php template then your corresponding controller should be also called blog.php in the controllers folder.
I thought putting the SEO bare minimum to get the plugin working code in the site.php would be appropriate as I want it to work on all pages? And then just have the contact.php one with the controller relevant to the form that will only be on that page?
site.php is not a shared controller but a default/fallback one. If you want to actually use it as a global/shared controller you have to take a few extra steps. Shared Controllers | Kirby CMS
I don’t know, I’ve been trying for 3 hours now still can’t get it to work, I have tried your code in controllers/contact.php and it says “compact(): Undefined variable: site” really not sure what I’m doing wrong