We are using Wordpress 4.2.2 & CiviCRM 4.6.1. We have a couple of fundraising events in which participants have the option of creating a Personal Fundraising Page.

When participants share their PCP URL on Facebook the link preview doesn't share any info from their PCP—Page Title, Description or Photo—and doesn't link to their page, it links to the Base page that has been set for CiviCRM in Wordpress.

Is there a way to add Open Graph tags to each PCP? I did see that Mathieu created a Drupal module that adds Open Graph tags on PCP pages for Facebook a few years back: https://github.com/mlutfy/civicrmogp. Does anyone had any ideas for Wordpress?

I do know that there are plugins for Wordpress that allow you to add Open Graph Meta tag info to your website. These allow you to set that info for individual Pages or Posts, however the PCPs are generated dynamically through CiviCRM using the base Wordpress page that I configured, so setting Open Graph info on that page would cause all the PCPs to share the same info on FB—unless I don't know what I talking about (which is totally possible).

Here are some screenshots to help show what I am talking about: This is what the link preview looks like when posted to Facebook

This the page that you are taken to when you click on the link preview

3 Answers 3


As you've discovered, this is not something that the WordPress plugin does by default. You can, however, hook into the 'civicrm_basepage_parsed' action that is fired when (ahem) the basepage has been parsed and roll your own Open Graph tags to be included in the markup via 'wp_head'. The content of the basepage is available via the 'basepage_render()' method of class 'CiviCRM_For_WordPress_Basepage', which can be externally accessed with the following code:

$content = civi_wp()->basepage->basepage_render();

Admittedly, this won't tell you what kind of Civi content is being included in the basepage, but the technique above will allow you to produce something more sensible than what you currently have.


There is a CiviCRM native extension available also: https://civicrm.org/extensions/ogp

I have not tested PCP pages recently, but I've been working on improving various aspects of the extension and will be happy to fix if there are PCP-specific issues.


PCP shortcodes are now available for both the info and transaction pages.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.