Google recommends that your website should be accessible either with www or without www, but not both. To enforce this, you need to configure a redirect to your preferred version. Follow these steps:
Sign in to cPanel.
Go to the Nginx Automation section and select CLOUDNS.
Choose your domain and click Configure.
Click on Redirections.
From the www Redirect dropdown, select your preferred version (with www or without www).
Click Submit to save the changes.
Ensure your preferred domain (with or without www) is correctly set in Settings → General in the WordPress dashboard.