The most common way of setting a cover image for any WordPress Page and Post to be used when it gets shared on Social Media platforms is by using specialized SEO plugins.
Besides the fact that a dedicated SEO plugin will help with the website's SEO optimization, it will also provide a simple way to add all the details used when a Page or a Post is shared on Social Media Platforms.
Our recommended SEO plugin is RankMath SEO.
Installing RankMath SEO plugin
Go to Dashboard > Plugins
Click on Add New
In the search box, type
Rank Math
In the search results list, click on it to install it
Once the RankMath plugin is installed, activate it.
Note: If this would be the first time the Rank Math SEO plugin is installed, it will walk you through some basic setup steps. Make sure those are followed
Setting the Cover Image on a Page/Post using Rank Math
Open the page for which the Cover Image has to be set up
Use the RankMath SEO options by clicking on its option
Click on the Social option to open the Preview Snippet Editor
Scroll down and find the Add Image Option.
Click on the Add Image button and select the Image that you want to use.
Note: Make sure that the image used for the Cover Image is at least 600x315px. The recommended size is 1200x630px.
Bonus Tip: You can use the Title and Description to set the desired title and description that will be shared along with the set Image.