This code snippet ensures that a default image is used for Open Graph meta tags when no specific image is set for a page or post.
add_filter( 'aioseo_opengraph_image', function ( $image ) {
if ( ! $image ) {
return 'https://example.com/default-image.jpg';
}