When you share your program pages in your social media accounts like facebook, sometimes the link preview that shows up doesn't accurate reflect the content of the link.
For example; the program image is the wrong image, the title and description text are from a different program, and the dates are incorrect.
The most common cause of this problem for wordpress websites using Retreat Guru's program listing plugin, is a conflict with the popular SEO plugin Yoast SEO.

The problem is caused by Yoast SEO overriding the content tags the Retreat Guru plugin is adding. But the Yoast SEO plugin is getting it wrong. The program listing, as well as the single program information pages, are all hosted on a single wordpress page.
The single program info pages are listed on the same page with a different url, the program id is included in the url.
eg: /123/my-program/.

Yoast SEO is just looking at the program list, picking the first program, and using it's image, title and description. Yoast adds <meta>  tags to the page that override the tags the Retreat Guru plugin add, which have the correct image, title, and description.

The fix is pretty simple, we just need to disable Yoast SEO for the Programs, and Teachers pages.

Here is how you can fix this problem. It requires some basic knowledge of PHP and web development, but even without you can do it if you have patience with yourself, and give it a try!

Steps To Solve

First thing is you will need to find the page ID for the Programs and Teachers pages that the Retreat Guru listing plugin is using for the listings.

You can find the pages you used in the wordpress Pages list.

When you find the program page, click to edit the page, and you can find the id in the url. This case the ID is 4.

You can also find the ID in the html of the front end view of the listings pages.

Right click near the top of the front end (client facing) listing page, and then select "Inspect".

This will bring up the HTML elements of the page in the developer console. You can scroll to the top of the console, and look for the <body>  element, and find the class "page-id-{{the program id}}".

The Code

Note This code was taken from this Stackoverflow thread.

You will need to be able to add some code to your theme functions.php  file.
You can do this in many ways, but one way is with a plugin like My Custom Functions.

This code assumes the following;

  • Program page id is 4 
  • Teachers page id is 5 

You will need to replace those numbers with your own page ids.

add_action('template_redirect','remove_wpseo');

function remove_wpseo(){
  $page_ids = [4, 5];
 
  if (is_page($page_ids)) {
    global $wpseo_front;
       
    if (defined($wpseo_front)) {
      remove_action('wp_head',array($wpseo_front,'head'),1);
    } else {
      $wp_thing = WPSEO_Frontend::get_instance();
      remove_action('wp_head',array($wp_thing,'head'),1);
    }
  }
}


This should solve the problem! Good luck! :)

For more help, here is a step by step tutorial video from RETSPRO on how to disable the Yoast SEO plugin on a single page.

Did this answer your question?