Support » Plugin: Yoast SEO » Yoast XML Parsing Error of RSS Feed

  • Resolved hastibe

    (@hastibe)


    I have selected the • (•) symbol for my title separator in Yoast, which is causing a XML parsing error preventing my RSS feeds from validating with this W3C Feed Validation Service error:

    This feed does not validate.
    
    line 12, column 30: XML parsing error: <unknown>:12:47: undefined entity [help]
    
    	<title>You searched for test &bull; My Website</title>

    I would like to keep the • (&bull;) symbol for my title separator, but need to remove the symbol from the RSS feed <title>–I think this could be considered a bug for Yoast, but -in the meantime- any help or suggestions on how this can be fixed would be very appreciated!

Viewing 15 replies - 1 through 15 (of 15 total)
  • // Change RSS feed titles
    add_filter( 'wp_title_rss', 'my_rss_filter', 20, 1 );
    
    function my_rss_filter( $rss_title ) {
        $rss_title = 'My Website';
        return $rss_title;
    }

    In case it’s helpful in finding a solution (or for others), I added the above code to my functions.php to change the initial <title>, but I still need to change the <title> of the <image>, and haven’t been able to figure out how to do that (see RSS snippet below).

    <channel>
    	<title>You searched for test &bull; My Website</title>
    	<atom:link href="https://www.my-website.com/?feed=job_feed&job_types=&search_location&job_categories&search_keywords=test" rel="self" type="application/rss+xml" />
    	<link>https://www.my-website.com</link>
    	<description></description>
    	<lastBuildDate>Thu, 18 Jun 2020 20:00:05 +0000</lastBuildDate>
    	<language>en-US</language>
    	<sy:updatePeriod>
    	hourly	</sy:updatePeriod>
    	<sy:updateFrequency>
    	1	</sy:updateFrequency>
    	<generator>https://wordpress.org/?v=5.4.2</generator>
    
    <image>
    	<url>https://www.my-website.com/wp-content/uploads/2020/03/logo.jpg</url>
    	<title>You searched for test &bull; My Website</title>
    	<link>https://www.my-website.com</link>
    	<width>32</width>
    	<height>32</height>
    </image> 
    • This reply was modified 1 month, 1 week ago by hastibe. Reason: Removed website name / URLs for privacy
    Plugin Support Michael Tina

    (@mikes41720)

    Hello,

    Could you confirm you are using the latest version of WordPress 5.4.2 and Yoast SEO for WordPress 14.4.1?

    Just to clarify, when using this specific title separator • (•) it causes issues when validating with W3C Feed Validation Service? Could you provide us with the link or steps on how to validate this so we can try and reproduce the error?

    Could you confirm you are using the latest version of WordPress 5.4.2 and Yoast SEO for WordPress 14.4.1?

    I am on WordPress 5.4.2 and Yoast SEO 13.5 (I like what y’all are doing, but haven’t yet felt comfortable updating to 14.0+, given updating issues still being encountered–I hope you understand!).

    Just to clarify, when using this specific title separator • (•) it causes issues when validating with W3C Feed Validation Service? Could you provide us with the link or steps on how to validate this so we can try and reproduce the error?

    Sure! Install Yoast SEO and set the “Title Separator” to the • (&bull;) symbol in Search Appearance > General. In the Search Appearance > Content Types tab, make sure the SEO title uses the separator.

    Then generate a RSS feed from the site that pulls the full title of the website. WP Job Manager by Automattic will do this, for instance, when it generates RSS feeds.

    In the linked example above, notice the <title>Search Results for “test” – Demo</title> line under the <channel> tag and the <image> tag?

    The symbol they use as a separator ‘–’ doesn’t cause RSS feed validation issues, but the &bull; symbol does cause RSS feed validation issues (most RSS feed widgets and plugins use the W3C Feed Validation Service, which can be used to test).

    Replacing the &bull; symbol in the lines of code just below in /wp-content/plugins/wordpress-seo/inc/options/class-wpseo-option-titles.php with its HTML code version allows the RSS feed to validate.

    'sc-bull'   => [
     'option' => '&bull;',
     'label'  => __( 'Bullet', 'wordpress-seo' ),
    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Thanks so much for taking the time to write all of that out. We are sorry that you’ve had to deal with this.

    We have used the Yoast SEO &bull; title separator in a fresh WordPress installation and tested the /feed/ by using the W3C Feed Validation Service but were unable to reproduce the issue on our end. Te W3C Feed Validation Service validates the feed correctly as expected.

    We see that Yoast SEO is automatically excluding the title separator and site name on our end and such, the RSS feed validates just fine as expected.

    Therefore, can you please confirm whether you have made any customization on the feed? If not, please share the relevant page URL here with us so that we can test it on our end.

    We see that Yoast SEO is automatically excluding the title separator and site name on our end and such, the RSS feed validates just fine as expected.

    Thanks for investigating, @mazedulislamkhan — that is the case for /feed/ for us, too, but the feed we use is for job posts generated by WP Job Manager. The feed it generates (here’s an example from their demo site) doesn’t exclude the title separator for the channel’s <title> tag or the image’s <title> tag, resulting in feed validation failure.

    Is this an issue with Yoast needing to change coding for titles generated by some RSS feeds or is this an error in coding of WP Job Manager?

    Plugin Support Pcosta88

    (@pcosta88)

    Hi,

    Can you elaborate more on how the plugin is set-up on the site? Can you also let us know exactly which title tag is expected to show the bullet? We ask as we are not familiar with the WP Job Manager plugin and it is not clear what title tag you are referring to. The title of the site or the title of the job?

    Are you able to take a screenshot that elaborates more on the issue? You can use a tool like: https://pasteboard.co/ to share the image.

    When we selected the bullet (see image: https://pasteboard.co/JfkxMES.png), we created a job and the bullet appeared as the title in the source code. See image: https://pasteboard.co/Jfky1gM.jpg.

    We then appended /?feed=job_feed/ to our testing site and in the RSS feed that title separator failed to appear both for the title of the site and the title of the job. See image: https://pasteboard.co/JfkyHVP.jpg

    Can you elaborate more on how the plugin is set-up on the site?

    The default setup of (i.e. simply installing and activating) both the WP Job Manager and Yoast SEO plugin with the bullet (&bull;) title selector selected and included in the “Search pages” SEO title (via Search Appearance > Archives in Yoast SEO) should replicate the RSS feed validation error.

    Can you also let us know exactly which title tag is expected to show the bullet? We ask as we are not familiar with the WP Job Manager plugin and it is not clear what title tag you are referring to. The title of the site or the title of the job?

    It is related to the title of the site; please see these screenshots for clarification:
    pasteboard.co/Jfld2a8.png

    Plugin Support Pcosta88

    (@pcosta88)

    Hi,

    You identified several issues. We have responded to them below.

    A. Search Page
    The Search Pages as referenced in the image is not expected to output the title of the site in an RSS feed. Were you expecting to edit the title here and have it replace the site title in the RSS feed?

    B. Site Title Tag in Jobs Feed
    In our testing we are unable to generate the site title to appear with a title separator. In fact, it the only way to change the title was to go to Settings-General-Site Title. Whatever was entered into that field changed the site title.

    In addition, we had a feature request several years ago to provide a way to edit the titles in RSS feeds but we closed it. You can see it here https://github.com/Yoast/wordpress-seo/issues/2964.

    Did you use custom code to force Yoast to output the bullet? If so, there is a code snippet that is part of the issue that may be useful for you. We have not tested it so we cannot if it is still valid.

    Also, as a test if you remove the any custom code and clear your caching do you get the same results from the feed validator tool? This would help us know if it is an issue with Yoast or an issue with the custom code.

    C. Image Title Tag in Jobs Feed
    In our testing, it seems like only one image tag is outputted in the feed. The only way to change it would is described in B, above.

    If you are using custom code to output the bullet and are having difficulties editing Yoast to output either the image title tag or the site title tag, you will need to develop on the plugin. We say this as Yoast does not have a way to edit those tags on an RSS feed.

    Unfortunately, there’s a difference between the support we can offer and the level of programming needed to change (core) 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.

    If needed, we highly recommend checking out the Yoast supported partners here: https://yoast.com/yoast-partners/. 

    In our testing we are unable to generate the site title to appear with a title separator. In fact, it the only way to change the title was to go to Settings-General-Site Title. Whatever was entered into that field changed the site title.

    @pcosta88 — that is surprising to hear, as I am encountering this issue (the title separator appearing in the RSS jobs feed) when using a default theme (e.g. Twenty Nineteen v1.6) with just WP Job Manager v1.34.2 and Yoast SEO v13.5 activated, without any custom coding that changes Yoast’s behavior or the generation of site or page titles and with caching cleared. With this setup (on my testing website), the output of the site title tag and image title tag in the jobs RSS feed is set by the “Search pages” SEO title in Search Appearance > Archives in Yoast SEO.

    In case it’s helpful to have other examples of this behavior, the title separator is also being output in the site title of the jobs RSS feeds of these websites running WP Job Manager:

    Plugin Support Michael Tina

    (@mikes41720)

    Hello,

    We tried testing this out with a clean site on WordPress 5.4.2, the default WordPress TwentyTwenty theme, and the only plugins enabled were Yoast SEO for WordPress v14.4.1 and WP Job Manager v1.34.2. We then created a sample job and then went to the Job page and used a keyword search to look for the created sample job. We then clicked on the RSS button next to the job listing. It loaded the RSS page. It did output the title separator but instead of showing &bull; it showed as and we took this URL and tried to validate it in WC3 Feed Validation Services and told us this is a valid RSS field. There were some warnings regarding whitespace, but it wasn’t related to the title separator, so we’re unable to reproduce the issue from our end. Perhaps testing this with v14.4.1 of the plugin will yield similar results for you?

    Thanks so much for the update, @mikes41720 — could you check what you had the title separator set to (in Search Appearance > General), though? Was it set to the bullet separator like in step #1 of my screenshot?

    If not, it has to be set to that bullet title separator to generate the &bull; separator in the jobs RSS feed. Changing the bullet title separator from the HTML entity to the HTML code (as listed here) will allow the jobs RSS feed to validate, and might be something to consider for a future Yoast update.

    Plugin Support Michael Tina

    (@mikes41720)

    Sorry for the incorrect information. We did make sure to set it as the &bull; title separator: https://pasteboard.co/JfrApcG.png & https://pasteboard.co/JfrAE7s.png

    It showed as & # 8 2 1 1 ; (which is still the bull separator, but without the spaces) — https://pasteboard.co/JfrDm4W.png

    and still showed that the RSS feed was valid.

    @mikes41720 — interesting, so it seems like WP Job Manager’s jobs RSS feed title isn’t being set by Yoast SEO on your build.

    The title in your jobs RSS feed screenshot begins “Search Results for…” and uses the – (& # 8 2 1 1 ;) symbol title separator, even though I saw that you had Yoast SEO’s Search page SEO title set to “You searched for (Search phrase)(Page)(Separator)(Site title)” with the • (&bull;) symbol separator.

    On my jobs RSS feed (see step #3 in the screenshot), Yoast SEO is setting the title, which you can see as it does begin “You searched for…”

    I wonder what could be causing the difference in behavior–unless it’s just something that has changed between my version of Yoast (13.5) and your version (14.4.1). When I upgrade to 14.4.1, I’ll do some more testing and let you know what happens!

    Plugin Support Jeroen Rotty

    (@jeroenrotty)

    Hi @hastibe,

    Yes please, keep us posted on that progress. Thanks!

    hastibe

    (@hastibe)

    Updating to 14.4.1 (completed successfully, including the re-indexing, phew!) resolved this issue (behavior is now the same as @mikes41720’s)–thank you for all the time and help in investigating, @mikes41720, @mazedulislamkhan, @pcosta88, and @jeroenrotty!

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.