Skip to content

Enabling filters for the "Rewrite & republish" feature #399

@menno-ll

Description

@menno-ll

Is your feature request related to a problem? Please describe.

We are using Yoast Duplicate Post in combination with the Distributor plugin.
When you do that you'll need to make sure to exclude certain meta fields set by Distributor.
This will prevent duplicated posts from having the same Distributor mapping, and influencing eachother.
Documentation reference: https://10up.github.io/distributor/tutorial-exclude-meta-from-yoast-duplicate-post.html

Now when using the Rewrite & republish feature of the Yoast Duplicate Post plugin, we have spotted that filters (including the one used in the documentation page above) are bypassed (see code in post-duplicator.php line 160, post-republisher.php line 366 and post-republisher.php line 348. This then causes multiple issues, where Distributor is conflicting with Yoast Duplicate Post. For example:

  • When you "merge" the rewritten post to the original post, distributor deletes the distributed post on the other subsite (as after merging, the rewritten post gets deleted)
  • When you edit a concept rewritten post, the changes are directly distributed to the distributed post on the other subsite.

For a detailed description, please also refer to my comment at the issue reported at the Distributor repository.
10up/distributor#1298 (comment)

Describe the solution you'd like

I think the easiest solution would be to set the use_filters option to true in the options array created in:

I don't know if there are scenario's I didn't think of that would make changing this option a problem. Hopefully you are able to have more insight in that than I do.

Otherwise, please consider still applying the duplicate_post_excludelist_filter filter even though use_filters setting is set to false.

Why do you think this feature is something we should consider for the Yoast SEO plugins?

Allowing more filters to be used is almost never a bad idea. It will allow theme developers to create custom functionalities, or fix issues. In this case, it will allow using two plugins together that both make writing content easier.

The duplicate_post_excludelist_filter filter has been created to allow developers to not copy over some metadata for duplicated posts. However if the filter isn't called for the Rewrite & republish feature, the Rewrite & republish feature will be unusable for everyone that's using the filter.

Additional context

The issue has originally been reported in the Distributor plugin.
Deeper analysis of the problem made us conclude that we actually need to look for the solution in the Yoast Duplicate Post plugin. That's why this issue exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions