• Resolved UmbrellaWeb

    (@umbrellaweb)


    Hello,

    Super plugin and love the fact that there are no trackers! unlike other bloated plugins.

    Came accross an issue when doing some checks on a dev site which we are planning to launch. The schema output for the knowledge graph/orginsation for the URL output is referincing the wordpress install URL rather that the sites actual URL.

    We have installed wordpress in a custom directory to split it from theme etc and looks like your outputted schema is displaying that. Not only is it the wrong URL for the schema but its also a potential attack vector (Iknow its small but why disclose if it can be helped) so peopel can try and hack main wp login.

    Here is what it outputs:

    @context":"https:\/\/schema.org","@type":"Organization","name":"BUSINESS NAME","url":"https:\/\/DOMAIN\/ACTUAL SITE\/CUSTOM WP DIRECTROY","logo":

    How can we fix that? wordpress general settings correctly refernece both the wp url and site url (with te wp one being different). We cannot launch with the url like that as we dont want to turn off seopress OR have to use a different plugin!

    Eagerly await a reply…

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,

    WordPress stores URLs in absolute.

    You have to use plugins like Better Search and Replace or WP CLI to properly search and replace your staging URL to final domain name:

    https://www.seopress.org/support/tutorials/search-and-replace-urls-wordpress/

    https://wordpress.org/plugins/better-search-replace/

    If you only change the wp url and site URL in DB, you will have a lot of issues.

    Hope that helps!

    Thread Starter UmbrellaWeb

    (@umbrellaweb)

    Hello @rainbowgeek Benjamin,

    First, glad the sites back working correcty and that we can now see the hooks page(s).

    OK, so i think you have misunderstood. We havent moved the dev site yet. Doing final checks prior to moving AND thats when we have come accross this issue.

    the ORG URL in the schema is not outputting correctly. There isnt a mismatch in the DB as far as we can see and ALL other URLS outputted be it for breadcrumbs, home menu etc are how they should.

    Here is the code outputted via the plugin for the org schemea (names removed for privacy reasons)

    <script type="application/ld+json">
                {"@context":"https:\/\/schema.org","@type":"Organization","name":"BUSINESS NAME","url":"https:\/\/dev.domainname.co.uk\/subfolder\/WPFOLDER","logo":"https:\/\/dev.domainname.co.uk\/subfolder\/app\/uploads\/2021\/01\/logo.png","sameAs":["https:\/\/www.facebook.com\/FBPAGE","https:\/\/twitter.com\/TWITTERPAGE"],"contactPoint":[{"@type":"ContactPoint","telephone":"123456789","contactType":"customer support"}]}        </script>

    where is states WPFOLDER is where the issue is. that shouldnt be there.

    Compare that to the plugins outputted breadcrumb schema:

    <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dev.domainname.co.uk\/subfolder\/"},{"@type":"ListItem","position":2,"name":"T-Shirt with Logo","item":"https:\/\/dev.domainname.co.uk\/subfolder\/t-shirt-with-logo.html"}]}</script>

    Notice that the home item url ends correctly.

    As already mentioned (and by you too) the site / wp url in general settings are also correct.

    Again ALL other URLS we have checked everywhere being outputted are correct. They do NOT include the WPFOLDER reference anywhere. Its just the org schema that seems to be doing so….

    Hope that makes more sense?

    Plugin Author Benjamin Denis

    (@rainbowgeek)

    Yes it makes sense now 😉

    Can you confirm everything is correct from SEO, Social settings?

    Note that if you’re a PRO user, please open a support ticket from your customer area. Thank you!

    Thread Starter UmbrellaWeb

    (@umbrellaweb)

    > Can you confirm everything is correct from SEO, Social settings?
    yes all settings look to be correct… double checked and cannot figure out why its adding in that extra folder to the url

    not a pro user…

    Plugin Author Benjamin Denis

    (@rainbowgeek)

    If you make a search of your incorrect domain name from phpmyadmin (or equivalent), do you have some results in the wp_options table that can explains the issue?

    Do a backup before editing your database, safety first!

    Thread Starter UmbrellaWeb

    (@umbrellaweb)

    Hello Benjamin,

    If you make a search of your incorrect domain name from phpmyadmin (or equivalent), do you have some results in the wp_options table that can explains the issue?

    Firstly, its NOT an incorrect domain BUT the addition of the folder being added just to clarify..

    Secondly, spent some time searching the DB and apart from the: siteurl filed in the wp_options table NO other refernce exists for https://dev.domainname.co.uk/subfolder (where subfolder represents the wordpress install directory).

    The home url option in wp_options table correctly refernces the right url: https://dev.domainname.co.uk/

    SO the DB doesnt have an incorrect entry.

    Looks like its the way the schema code url is being called and used?

    Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,

    can you go to this file:

    /wp-content/plugins/wp-seopress/src/Tags/Schema/SiteUrl.php

    At line 19, replace site_url() by home_url()

    Is this better?

    Please let us know, thanks!

    Thread Starter UmbrellaWeb

    (@umbrellaweb)

    Hello Benjamin,

    Great, thats working as expected now 🙂

    Will this be applied in the next update? or will this change need to be manually implemented each time the plugin updates?

    Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi @umbrellaweb,

    we’ll probably add a hook to filter this value from your own theme or must use plugin in the next update.

    This way, your change will be kept each time we update the plugin.

    Thread Starter UmbrellaWeb

    (@umbrellaweb)

    Hello Benjamin,

    Great, thats fine. many thanks for ALL your help 🙂

    Have a great day.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Schema Orgonisation URL WRONG’ is closed to new replies.