• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Changing the og:url tags to http to retrieve social media numbers

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Changing the og:url tags to http to retrieve social media numbers

This topic is: not resolved

Tagged: https://, meta tags, open graph, social media numbers

  • This topic has 7 replies, 2 voices, and was last updated 8 years, 1 month ago by Brad Dalton.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • April 6, 2017 at 7:55 pm #204414
    David Borrink
    Participant

    After upgrading my web sites to https, I've run into the unexpected loss of social media numbers.

    I was advised by a Sumo rep on the WordPress boards to manually make my og:url meta tags point to the http version of our site instead of https. But I got a weird problem. In my <head> area in the Genesis settings panel, I have these meta tags settings…

    <meta property=“og:url” content=“http://sallieborrink.com” />
    <meta property=“og:title” content=“Sallie Borrink />

    But when I check the source code, it comes up as…

    <meta property=“og:url” content=“https://sallieborrink.com” />
    <meta property=“og:title” content=“Sallie Borrink />

    Something is putting the s back into the http, even though I didn’t put it in there. And what makes this even weirder is that I tried changing the url to http://salliexborrink.com just to make it different, and it showed up as http in the source. But, change it back to the correct url as http://sallieborrink.com and the https returns.

    I’m baffled. That’s the only place in the source code that has the og:url tag. What could be causing this kind of behavior?

    https://sallieborrink.com
    April 6, 2017 at 9:02 pm #204416
    Brad Dalton
    Participant

    You could use str_replace to change the https to http.

    Or

    You could remove the s using substr

    Or even preg_replace


    Tutorials for StudioPress Themes.

    April 7, 2017 at 9:29 am #204438
    David Borrink
    Participant

    Wouldn't that change all instances of my URL, even in the content? I want to be able to change that in the og:url spot in the meta property that goes in the head, not wanting it to change all urls in my content.

    Obviously I'd be using this, correct? ...

    <?php
    echo str_replace("https","http","https://sallieborrink.com");
    ?>
    April 7, 2017 at 5:44 pm #204468
    Brad Dalton
    Participant

    David

    I would filter the og tags using one of the functions i suggested above. Thats my suggestion.

    The og tags are added via a plugin not WordPress or Genesis.


    Tutorials for StudioPress Themes.

    April 7, 2017 at 8:29 pm #204481
    David Borrink
    Participant

    Thanks for the reference to the W3 PHP pages.

    Okay, so I see how they all can work. So if I'm filtering a og tag, how would I syntax that in functions.php? Obviously if I just do https://sallieborrink.com, I'm going to be affecting every instance in the site, content an all, correct? Do I need to put the whole meta tag in the function, then define where to strip it out?

    April 8, 2017 at 4:41 pm #204507
    David Borrink
    Participant

    Okay, I tried this in my functions.php file:

    echo str_replace("http","https","meta property=“og:url” content=“https://sallieborrink.com” /");

    And I got this across the top of my page above the header:

    meta property=“og:url” content=“httpss://sallieborrink.com” /

    And the source code read"

    <meta property=“og:url” content=“https://sallieborrink.com” />

    I'm obviously not doing this right.

    April 8, 2017 at 9:35 pm #204509
    Brad Dalton
    Participant

    You need to use the filter applied in the plugin to modify the default output. Thats something you'll need to get from the plugin developer or dig into the plugin and find.


    Tutorials for StudioPress Themes.

    April 8, 2017 at 9:43 pm #204510
    Brad Dalton
    Participant

    I'm assuming Sumome adds the og tags.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble