Hello Nicklas,
Thanks for reaching out regarding the compatibility between the Yoast SEO plugin and PHP 8.1.
Unfortunately, we haven’t yet fully tested the plugin with PHP version 8. The entire WordPress community is still working on it. You can read the https://developer.yoast.com/blog/the-2020-wordpress-and-php-8-compatibility-report/.
The WP Core itself isn’t fully compatible with PHP 8.x. Also, Yoast SEO plugins may run into some deprecations coming from WP Core.
For Yoast SEO to run properly, you should have a PHP version of 5.6.20 or higher. We recommend PHP version 7.3 or above. Before you upgrade to a higher PHP version, check if your WordPress site is ready for it. Read this helpful article to learn how to update your PHP version.