Dmitry
Forum Replies Created
-
I noticed that “document_title_parts” changes parts of the title on all paginated pages except for author pages.
Meanwhile, “slim_seo_data” does the opposite: it changes the title part on author pagination pages but not on the others.
Additionally, on author pagination pages, there is no separator between the author’s name and “Page 2.”
For example, on the pagehttps://example.com/author/admin/page/2/, the title appears as:
Admin Page 2 of 5 – My Blog
But it should be:
Admin – Page 2 of 5 – My BlogYou don’t need to install an additional plugin. Just add this code snippet to your theme’s functions.php file and everything will work.
Hello @plittlefield! If you want to remove the author tag, use the following snippet:
add_filter( 'slim_seo_linkedin_author', '__return_empty_string' );Search bots do not see this link. It is displayed only in the user’s browser.
If you want to remove this, then try adding this code to the functions.php file:
add_filter( 'slim_seo_sitemap_style', '__return_false' );This will remove the sitemap styling.
Hello Nirr! The breadcrumbs you see in search results are derived from schema markup.
This filter should help:add_filter( 'slim_seo_breadcrumbs_links', function( $links ) { if ( is_singular( 'post' ) ) { unset( $links[1] ); } return $links; } );To ensure that the category is no longer visible in the schema markup, check the post page here:
https://search.google.com/test/rich-resultsYou need to add the “@id” property to the
\src\Schema\Types\ReadAction.phpfile so that there is a connection with the “potentialAction” property of the WebPage markup.
Like this:namespace SlimSEO\Schema\Types; class ReadAction extends Base { public function generate() { return [ '@type' => 'ReadAction', '@id' => $this->url . "#readaction", 'target' => $this->url, ]; } }Hello Anh Tran! In schema markup: an object with type ReadAction is missing from the “@graph” array, although WebPage now has a “potentialAction” property containing the value
{"@id":"https://example.com/hello-world/#readaction"}
Regarding the display of dates: I forgot to mention in this topic about the file\src\MetaTags\LinkedIn.php, in it you also need to replace gmdate() with wp_date().Hi @phaze75! Yes,
sitemap.xmlandsitemap_index.xmloutput the same sitemap. As for Google Search Console, in my case it refused to accept the sitemap namedsitemap.xml, giving a reading error, but Google accepted the mirror address of thesitemap_index.xmlmap without any problems.@phaze75 try using a mirror sitemap URL to add to Google Search Console:
/sitemap_index.xml
In my case Google accepts it to be added, unlike/sitemap.xml
Specify the new sitemap URL in your robots.txt file:User-agent: * Disallow: /wp-admin/ Allow: /wp-admin/admin-ajax.php Sitemap: https://example.com/sitemap_index.xmlwhere is example.com your website domain
If you are using a virtual robots.txt file, then you can change it via mu-plugin.
Add a PHP file with the following code to the/public_html/wp-content/mu-pluginsfolder:<?php add_filter( 'robots_txt', function ( $robots ) { $old_sitemap = "sitemap.xml"; $new_sitemap = "sitemap_index.xml"; $robots = str_replace($old_sitemap, $new_sitemap, $robots); return $robots; }, 11 );- This reply was modified 1 year, 9 months ago by Dmitry.
Hi Sybre!
I have sent you a message 4 days ago about a problem with the card sitemap.xml at your request, through this form: https://tsf.fyi/contact
I hope you received it.Looks like it’s a temporary error at Google. And it is only related to one of my sites. I backed up my site and decided to do a clean install of wordpress with a new database for the sake of experimentation. I uninstalled Akismet and Hello Dolly, selected “Post name” in Permalink Settings, then installed TSF plugin. I try again to add
sitemap.xmlin Google Search Console, same error: “Sitemap could not be read”.
Regarding Nginx configuration, I have my site on VPS and I have full control over hosting settings, I have no rules in Nginx configuration that could affectsitemap.xml.
There is another site with TSF plugin installed on the same VPS, its google sitemap reads without problems.1. The mu-plugins folder in WordPress is for adding special plugins called must-use plugins. The mu-plugins folder is not included in the default WordPress installation. If you want to use must-use plugins, you need to create this folder manually inside the wp-content folder. Once the mu-plugins folder is created, you can add PHP files with plugin code to it and they will be automatically activated.
2. You can name the file with any name, for example aggregate-rating.php
When the files are found in the mu-plugins directory, WordPress will automatically enable these files. This means that the code in these files is executed every time WordPress is loaded. Plugins such as The SEO Framework can then use this code if it provides features or hooks that the plugin expects to see.3. For example, if you create a new PHP file in the mu-plugins folder with whatever name you want (e.g. aggregate-rating.php) and add the code to it:
<?php function my_custom_schema( $data, $context ) { if (is_single(10)) { $data[] = [ "@type" => "AggregateRating", "ratingValue" => "88", "bestRating" => "100", "ratingCount" => "20", ]; return $data; } elseif is_single(11)) { $data[] = [ "@type" => "AggregateRating", "ratingValue" => "95", "bestRating" => "100", "ratingCount" => "25", ]; return $data; } elseif is_single(12)) { $data[] = [ "@type" => "AggregateRating", "ratingValue" => "96", "bestRating" => "100", "ratingCount" => "24", ]; return $data; } else { return $data; } } add_filter( 'the_seo_framework_schema_graph_data', 'my_custom_schema', 10, 2);then he AggregateRating markup will appear at the end of the graph array on article pages with IDs 10, 11 12.
Post IDs can be viewed on the/wp-admin/edit.phppage and in the list of all entries, hover your mouse over the title of the post for which you want to find out the ID. A line on a gray background will appear at the bottom of the screen showing the ID of that post (post=id). The post ID is the number that comes right after the posts= parameter.
This way you can add any markup with different properties and values for each post with a specific ID.The list of markups that are supported by Google Search can be found here: https://developers.google.com/search/docs/appearance/structured-data/search-gallery
You can test the markup on this page: https://search.google.com/test/rich-resultsStructured data is powerful, but you must follow Google’s strict policies in order to be eligible for this. If you fail to comply, they’ll flag your website for spam.
Hello! As far as I know, you can use the
the_seo_framework_schema_graph_datafilter to control the schema markup output.
Here is a code example that adds a schema object to the graph array:function my_custom_schema( $data, $context ) { // Checking that it’s an article page if (is_single()) { $data[] = [ "@type" => "AggregateRating", "ratingValue" => "88", "bestRating" => "100", "ratingCount" => "20", ]; return $data; } else { return $data; } } add_filter( 'the_seo_framework_schema_graph_data', 'my_custom_schema', 10, 2);The following schema object will be added to the graph array:
{"@type":"AggregateRating","ratingValue":"88","bestRating":"100","ratingCount":"20"}This was an example of how to add your structured data to a post page.
The code can be added via mu-plugin in the /wp-content/mu-plugins folder.Why doesn’t TSF add a link tag with the canonical post URL on page_comments pages?
Here’s what it looks like for other SEO plugins:Yoast:
<meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' /> <link rel="canonical" href="https://example.com/hello-world/">—
Rank Math:<meta name="robots" content="follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large"/> <link rel="canonical" href="https://example.com/hello-world/" />—
AIOSEO:<meta name="robots" content="noindex, nofollow, max-image-preview:large" /> <link rel="canonical" href="https://example.com/hello-world/" />—
SEOPress:<meta name="robots" content="index, follow"> <meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"> <meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"> <link rel="canonical" href="https://example.com/hello-world/">—
Squirrly SEO:<meta name="robots" content="index,follow"> <meta name="googlebot" content="index,follow,max-snippet:-1,max-image-preview:large,max-video-preview:-1"> <meta name="bingbot" content="index,follow,max-snippet:-1,max-image-preview:large,max-video-preview:-1"> <link rel="canonical" href="https://example.com/hello-world/" />—
Slim SEO:<meta name='robots' content='max-image-preview:large, max-snippet:-1, max-video-preview:-1' /> <link rel="canonical" href="https://example.com/hello-world/comment-page-1/#comments">As you can see from the examples above, almost everyone adds a link tag with the canonical URL of the post, with the exception of Slim SEO, which has a comments page instead of a post page. And noindex, nofollow only adds AIOSEO.
Hi Sybre! I noticed another peculiarity with your plugin, if you add ?replytocom=3#respond to the URL at the end, another robots meta tag appears in the page code:
<meta name='robots' content='noindex, follow' />Let’s take your website for example:
https://theseoframework.com/blog/reforming-our-subscriptions/?replytocom=3#respond