• Resolved Rahul Kharbanda

    (@rahulkharbanda972)


    Hi,

    I am getting unparsable syntax errors on the google structured data testing tool, with URLs or images as objects when I have 2 quotes like"https://url", in the schema, we need a single 'https://url' quote to avoid errors.

    If the JSON-LD is “text” as an object.

    How can I get this achieved on the classic WYSIWYG Editor, with a function maybe esc_url, or preg_replace

    If I go to the editor’s text option and do it manually that makes it again to "https://url"

    I am using AMP Standard Mode, I don’t need to use any plugins to do this and can’t live without classic WYSIWYG Editor, maybe using CLE Editor has solved this but its a pain to use it.

    Kindly Help me.

    Thanks

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • WordPress core is not outputting the JSON-LD. You need to ask at the support forum for whatever plugin or theme you are using that is outputting that.

    Thread Starter Rahul Kharbanda

    (@rahulkharbanda972)

    Ok,

    I am not using any plugin, the theme is Default Twenty Twenty, SEO Plugin Yoast I have turned off for the custom post type as I am doing a manual schema on a particular post.

    Everything is fine just I am stuck, with Classic Wp Editor Outputing double quotes around URLs.

    Anyways if you are sure it’s beyond WordPress core. I will look around on my own.

    Thanks,

    Rahul

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Double quotes, as in the links on this page, are perfect legit.

    Are these the double quotes you’re referring to?

    <div class="schema-how-to wp-block-yoast-how-to-block"><p class="schema-how-to-total-time"><span class="schema-how-to-duration-time-text">Time needed: </span>5 minutes. </p><p class="schema-how-to-description">Sequel Pro is a SQL Database Manager to Manage SQL Database, Locally on Mac.<br><br>It would be best if you got the Sequel Pro Nightly Build from this <a rel="noreferrer noopener" href="https://sequelpro.com/test-builds" target="_blank">Official Link Here</a>, <br><br>The reason for the Nightly build is simply it Worked and the other one did not!<br><br>The App is 100% Free, and you will get a local interface to connect to your database via SSH remotely within minutes.<br><br>I have also given its usage in one of my recent posts <a href="https://netnaps.com/wordpress-on-mac-localhost-step-by-step/">WordPress on Mac localhost Step By Step Fast with Free SSL</a>

    Thread Starter Rahul Kharbanda

    (@rahulkharbanda972)

    Hi, Thanks for your reply.

    I don’t want to use Yoast for SCHEMA, I need to use SCHEMA of my own without a plugin.

    Yoast outputs schema markup with single quotes for URLs and image attachments inside the_content.

    If this works for me, I will delete Yoast from my site as I am not satisfied with its SCHEMA Markups at all reasons I am doing this!

    For Sitemaps, I can use the CORE WordPress XML Sitemaps.

    The editor as of its WYSIWYG functionality replaces ‘ with ” double quotes around <a href “http like this…

    Using CLE Editor does the job well but it’s very painful to post everything with manual html editing offline, I will do this if I don’t find a solution.

    maybe the function is preg_replace('/[”″]+/', '', $url);

    but I am not sure how to use this with url, or add a filter to use it only on the_content of a post?

    also, I have seen the pre sanitize features of metadata before it’s saved in the database of WP.

    also, this can be not good to use if a protocol is effected on the php code I am not sure about that.

    I also tried something like :

    add_filter( 'esc_html', function( $safe_text ) {
        return str_replace( '"', "'", $safe_text );
    }, PHP_INT_MAX );

    but I don’t want to touch the default formatting functions of WP.

    I don’t wish to use a plugin still blocks extension for HTML formatting with Gutenberg does this. I don’t use Gutenberg.

    If any help/idea I can get it done, please.

    thanks

    I’m going out in left field a bit but looking at what you’ve said…

    That ‘Google structured data testing tool’ is wanting just a URL in the input field. From there it should parse the HTML or XML at that location… If you are trying to hand the code itself to the tool then you’ll need to sanitize it and the results will probably not be what you want as the tool will then follow the links in the code and parse those pages or possibly just the first one.

    That tool you mentioned is not an API in other words and that tool is being deprecated also in favor of this…

    https://search.google.com/test/rich-results?utm_campaign=sdtt&utm_medium=message

    And this is way outside of anything in WordPress itself but if you really need this functionality for your site then you might want to consider creating a plugin to do that sanitization rather than modifying the WordPress core and creating a one-off install.

    Teaching WordPress to output it’s data to suite some other site or service is the realm of plugins, XML-RPC, and possibly functions code.

    I do hope this might help.

    Thread Starter Rahul Kharbanda

    (@rahulkharbanda972)

    @jnashhawkins Thanks,

    yes, the reply is helpful. I might need a plugin to do this or maybe a function as a MU plugin,

    I could find a Gist that changes the HTML Tags <P> from the content here, but maybe the quotes around these tags have a much different way to deal with.

    • wpautop
    • wptexturize
    • pre-sanitize functions
    • Many things on the editor and formatting are connected, and I don’t want to touch this.

      While Schema is going to take single quotes in the content URLs otherwise, it’s throwing away syntax errors, with apparent reasons its a JSON-LD type text on the Schema Script,

      Yoast exactly does this with the Schema and has millions of sites using it, though it’s a great plugin but lacks options for schemas,

      And any publisher would have to wait longer than expected for the enhancement with any SEO plugin and sync this with google requirements for validations,

      I have seen Missing tools, supply schema on the Yoast SEO, and since years many WordPress users have requested the same with no luck at all till date.

      Rank Math plugin doesn’t have this Schema also, and it’s not still better than Yoast.

      Why is this Important: I got an email from the search console to validate the fixes. I could not do so, and maybe with AMP Standard mode, it’s challenging to get all search console validations.

      Now I have two examples below that you can check the same (1) is done by Yoast that has How-to Warnings, the (2) is done manually and has no warnings at all on the same rich snippet testing tool you have linked above.
      Both of these are How-To

      1) How to use Calypso for WordPress

      2) How to Set up Google Web Stories On WordPress

      I just started up with using my own schema and luckily could get this done on my blog the hard way as you can see the replies above is one of them.

      The difference between the 2 URLs is, Article and How-To, While as per Yoast Plugin, every How-To is an Article, and that is by Default.

      Second difference is the (1) with the yoast is missing tools and supply.

      To end this topic here, if anyone can still answer, why are these ” double quotes still important in WordPress Editor?

      When with just having the Single ( ' ) quotes around

    • The Images Work Properly with single quotes
    • The Url’s Work Properly
    • Every Html Tag Works Properly
    • have checked this on Different Browsers
    • Thanks Again,
      Rahul

    When the browser is rendering the HTML on a page, it definitely doesn’t matter if single or double quotes are used.
    When the editor is sanitizing the user content for storage in the database, it does matter.
    If you want to present a schema to a search robot, it shouldn’t be forced in the place of what is intended for the browser. It should be generated from what is in the database and formatted for the robot. You can’t assume that the way that WP stores the data has anything to do with how it is presented to the requester.

    Just my opinion: you are spending too much time on Google. Just write content and be done with it. Forget about AMP and schemas. These will fade in importance, as all previous trends have.

    Thread Starter Rahul Kharbanda

    (@rahulkharbanda972)

    Just my opinion: you are spending too much time on Google. Just write content and be done with it. Forget about AMP and schemas. These will fade in importance, as all previous trends have.

    I agree with you @joyously

    Thanks

    Thread Starter Rahul Kharbanda

    (@rahulkharbanda972)

    Thanks, All

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Replace the double quotation marks around the link with a single quotation mark’ is closed to new replies.