Wordpress-seo: Conflict with the plugin "WP Permastructure"

Created on 24 Aug 2017  路  3Comments  路  Source: Yoast/wordpress-seo

Please give us a description of what happened.

The XML sitemap for posts ("post-sitemap") shows the following error:

TypeError thrown

Argument 2 passed to wp_permastructure::parse_permalinks() must be an instance of WP_Post, 
instance of stdClass given

It looks like this is a conflict with the WP Permastructure plugin.

Please describe what you expected to happen and why.

I expected the XML sitemap for posts.

How can we reproduce this behavior?

Click here: https://dev.crg.world/de/post-sitemap.xml

_In case I can solve this issue myself I would be happy to get any advice._

Technical info

  • WordPress version: 4.8.1
  • Yoast SEO version: 5.3.2
  • WP Permastructure version: 1.4.2
xml sitemap

Most helpful comment

Hi @cristopherrosenberg

I'm guessing that's trouble because Yoast SEO uses optimized query for fetching posts. You can try to replace this line in wp-permastructure.php:

public function parse_permalinks( $post_link, WP_Post $post, $leavename, $sample = false ) {
with
public function parse_permalinks( $post_link, $post, $leavename, $sample = false ) {

After this change, you need to purge sitemap cache. (try to disable/enable xml sitemaps).

All 3 comments

Hi @cristopherrosenberg

I'm guessing that's trouble because Yoast SEO uses optimized query for fetching posts. You can try to replace this line in wp-permastructure.php:

public function parse_permalinks( $post_link, WP_Post $post, $leavename, $sample = false ) {
with
public function parse_permalinks( $post_link, $post, $leavename, $sample = false ) {

After this change, you need to purge sitemap cache. (try to disable/enable xml sitemaps).

Hi Sa拧a,

it worked!! :-) Thank you very much for your great support!

Thanks again,

Christopher

We are happy to see that this issue has been resolved already :)

Closing the issue

Was this page helpful?
0 / 5 - 0 ratings