• Resolved stargirl1

    (@stargirl1)


    hi,

    i just installed SEO Yoast on my website for the first time today. everything looked fine until i shared a test post.

    i noticed that the URL is displaying incorrectly. well, it’s correctly displaying what my basic URL is. but i have purchased a .com that the URL is masked with. http://www.snailhunters.com (not .nl) is the preferred URL for the website. how can i make it so that the .com url shows when a post is shared?

    see screenshot: https://snipboard.io/qa7Ky3.jpg

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    We are confused and need more information to understand what exactly you’d like to achieve.

    We look forward to hearing from you.

    Thread Starter stargirl1

    (@stargirl1)

    sorry i thought the screenshot i provided clarified what i wanted. what i want to achieve is the URL where i circled in red on the screenshot should be the .com url. not the .nl url. both urls access the site. the .com masks the base url.

    1) the screenshot i showed is sharing it to facebook. i want people who visit my website to be able to share it to facebook and twitter.

    2) i am wanting people to be able to share anything, but mainly the blog posts as shown in my screenshot.

    3) when i purchased my website from my webhost i got a basic domain of https://www.snailhunters.nl. i then purchased the .com from godaddy. both urls can access my website. but the .com is the preferred method i want people to access the website when they see posts shared from the website on facebook or twitter. right now it is just displaying the base url and not the masked url. sorry if my technical terms aren’t accurate.

    • This reply was modified 3 years, 1 month ago by stargirl1.
    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Thanks for your clarification. The primary domain name of your website is https://www.snailhunters.nl/ and not http://snailhunters.com/. We see that you have used the </iframe> HTML tag to load the front page of your website on http://snailhunters.com/ which will still lead any pages to https://www.snailhunters.nl/.

    On the other hand, the URL you’d like to change called og:url and only shows the current URL that you’d share. Since the primary domain name of your website is https://www.snailhunters.nl/, it uses the URL correctly as expected as it won’t be beneficial if you use http://snailhunters.com/.

    That said, if you’d still like to change the og:url property, you’ll need to programmatically change it by using the wpseo_opengraph_url filter. Further information can be found here: https://developer.yoast.com/customization/apis/metadata-api/#opengraph-presenters

    We hope this helps!

    Thread Starter stargirl1

    (@stargirl1)

    hi, yes i’m aware that the .nl is the primary domain. as i stated i’d like the masking domain to show. where did i use <iframe>? i didn’t enter that anywhere. i don’t even understand what it means to use an iframe html tag to load the front page.

    i have no idea how to “programmatically change it”? can you please be more specific and tell me what i need to to to change it? i took a look at the page you provided but i am unsure of how to proceed. and is it something i need to change in my functions? and what exactly?

    ALL PAGES and POSTS should point to SNAILHUNTERS.COM. i wish NOTHING to point to snailhunters.nl. that is the purpose that i have purchased the .com domain. so everything points to there.

    • This reply was modified 3 years, 1 month ago by stargirl1.
    • This reply was modified 3 years, 1 month ago by stargirl1.
    Plugin Support Maybellyne

    (@maybellyne)

    @stargirl1

    Yoast SEO includes filters that allow you or your developer to customize many of the features in our plugin. These filters are documented inside the plugin code. We, also, have a developer portal where you can find more information about filters and even check out some examples of how to use them.

    The wpseo_opengraph_url filter can be used to change the og:url property. Typically code snippets are added to your theme’s functions.php file. If you’re not familiar with using code snippets, we’d like to refer you to the WordPress documentation on how to use a filter.

    Unfortunately, there’s a difference between the support we can offer and the level of programming needed to change features of our plugin. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. And even though we cannot be of any assistance, you’re completely free to change anything in the plugin to better suit your needs.

    Thank you.

    Thread Starter stargirl1

    (@stargirl1)

    hi, i am the website owner and designer. there is no additional developer. i understand how to use code snippets and i know how to put the customized functions in my child theme.

    what i do not understand is what exactly i need to place in the functions to change the og:url property. this is all new to me.

    your second link there talks about hooks. so now i’m confused if this is something i need to change in hooks or in the functions. my theme does have a section for entering hook content.

    your links did not provide me with the instructions on what i need to place in the functions to change the ol:url property. i did however find this link. is this what i need to change? but i still do not understand where to enter in my .com domain.

    https://gist.github.com/amboutwe/811e92b11e5277977047d44ea81ee9d4#file-yoast_seo_opengraph_change_protocol-php

    ********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
    
    /* Enforce HTTP Open Graph URLs in Yoast SEO
     * Credit: stodorovic https://github.com/stodorovic
     * Last Tested: Feb 06 2017 using Yoast SEO 4.2.1 on WordPress 4.7.2
     */
     
    add_filter( 'wpseo_opengraph_url', 'my_opengraph_url' );
    
    function my_opengraph_url( $url ) {
            return str_replace( 'https://', 'http://', $url );
    }

    if someone can just tell me what code i need to enter in the functions or hook to change the og:url property i have no problem doing it myself.

    Plugin Support devnihil

    (@devnihil)

    @stargirl1 Unfortunately we can’t offer support on custom code. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. Maybe someone watching these forums can assist you further, but if your topic is inactive for 7 days, we’ll mark it as resolved to keep the overview.

    Thank you for your understanding.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

    Thread Starter stargirl1

    (@stargirl1)

    hi,

    the issue was never resolved. but since i don’t have enough knowledge to make the changes to the code, after speaking to my webhost the simplest solution seems to be to move the extra purchased domain from godaddy to my webhost. then when i have the domain also by my webhost, i can select the desired domain as the primary domain. then i can use the yoast facebook and twitter cards without having to change the og:url.

    • This reply was modified 3 years ago by stargirl1.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘how can i display correct domain name’ is closed to new replies.