SEO / Open Graph sharing homepage rather than current page

I am using kirby-3 SEO plugin to help create meta tags and for sharing on social media etc.

When sharing it is giving me the correct page link but the sharing card is for the homepage

Screenshot 2020-08-18 at 15.54.19

Have you followed the readme to override the default settings in your controller? The twitter url etc. all point to the homepage if you inspect the code in dev tools.

I just copied the example code:

   <?php

return function ($page, $kirby, $site) {

  // Meta
  $seo = $kirby->controller('seo' , compact('page', 'site', 'kirby'));

  // Override Meta Title
  $metatitle = $page->seotitle().' | '.$site->title();

  $data = compact('metatitle');

  return a::merge($seo, $data);

};

Well, yes, but in this example you keep the original url settings instead of overriding the default urls.

Not sure I understand what you mean. My knowledge of php is pretty limited.

Here you override the $metatitle variable. In the same way you can override other settings. These are the defaults:

 // Meta
              'metatitle'         => $site->title(),
              'metadesc'          => $page->seometa(),
              'metakeywords'      => $page->seotags(),
              'metarobots'        => 'index, follow, noodp',
              'metaurl'           => $site->url(),
              'metaimage'         => $page->shareimage()->toFile() ? $page->shareimage()->toFile()->crop(1280, 720)->url() : ' ',

              // Facebook Meta
              'metafbtype'         => 'website',
              'metafbsitename'     => $site->title(),
              'metafblocale'       => 'en_GB',

              // Twitter Meta
              'metatwcard'         => 'large_summary',
              'metatwsite'         => $site->socialtwitterurl()->isNotEmpty() ? $site->socialtwitterurl() : ' ',
              'metatwcreator'      => $site->twittercreator()->isNotEmpty() ? $site->twittercreator() : ' ',

(Iā€™m not familiar with the plugin, just reading the code)