Hi,
If the robots.txt file is not writable or your WordPress install has disabled file editing, creating or editing robots.txt through the WordPress Dashboard may fail. In that case, you can edit at the server level. WordPress generates a virtual robots.txt file if the site root does not contain a physical file. To override the virtual file, please follow these steps to create a physical robots.txt file.
- Use your favorite text editor and create a text file.
- Save the empty file with the name robots.txt.
- Upload the file to your server. If you’re unsure where on your server to upload the file, please contact your webhost.
If WordPress was blocking access to the virtual file, you should be able to edit the physical file from our plugin. If not, you can always edit the robots.txt directly on your server using FTP or a server file manager. Please contact your webhost for assistance if you have trouble uploading or editing files on your server.
You can refer to this article for more information – https://yoast.com/help/how-to-edit-robots-txt-through-yoast-seo/
If that still doesn’t work, we might need to check things further on your website, but we are unable to do so over these public forums. You may want to consider a subscription of Yoast SEO Premium in order to receive updates and support.