I'm using a plugin to publish my posts and pages to social media automatically. The plugin uses the excerpt as a description for each post/page.
So I want the excerpt to get the first 140 characters of the post/page content and make it the excerpt by default for my current posts and pages but only if the excerpt for that post/page is empty so the post/page that already has an excerpt will remain as it was.
I believe this could be done by adding something to the functions.php file.
Thank you.