sybrew / the-seo-framework

The SEO Framework WordPress plugin.
https://theseoframework.com/
GNU General Public License v3.0
426 stars 47 forks source link

Add primary-category selection to quick/bulk-edit. #512

Open sybrew opened 4 years ago

sybrew commented 4 years ago

From Max's request:

Add the ability to select the primary category to list and bulk-edit.

I'm not sure whether we should add this via a radio button or a dropdown menu.

Fox-Robinson commented 1 year ago

Has this been added yet, given it was in 2020? I dont see it as an option in my post list.

sybrew commented 1 year ago

Hello! Thank you for showing interest in this feature -- it helps with prioritization.

Still, some features take years of preparation (waiting for new APIs, refactoring frameworks, resolving code debt, etc.). Since the issue is still open, it has yet to be implemented.

The feature is slated for 4.3.0 (which is the next update); however, features have been piling up for 4.3.0, so this may be punted to a future update if the schedule doesn't allow for it earlier.

Fox-Robinson commented 1 year ago

Hi there,

Thanks for the reply. I need this feature so I will use another SEO plugin.

sybrew commented 1 year ago

To be clear: primary term selection is already in the plugin, which is executed better than any other plugin.

I don't know why the option for bulk editing would be a dealbreaker, relinquishing one toward the mess that the others are. 🤷

Fox-Robinson commented 1 year ago

I have 4000 posts. Without bulk editing I need to go through each on in turn to set the primary category.

sybrew commented 1 year ago

I understand.

After setting the primary terms in bulk, you can take the primary term settings to TSF using our Transport extension. This works best via Yoast SEO, provided that they have implemented this bulk-editing feature.

Fox-Robinson commented 1 year ago

Hi there,

I did use Yoast. They don't have a bulk editing feature for primary categories so I used WP All Export to export all the posts and their fields, and then edited them there and re-imported. I tried this with Rank Mah too and it was possible., However, when I tried this with your plugin, the primary category field didn't appear in the spreadsheet. Infact I don't think any of your fields did which is odd. Do you know why your plugin is not making any of them available?

Also, do you have a function to get the primary category to make it available to other plugins, such as page builders? I can get Yoast's primary category using a function, but I cant see that option with yours.

sybrew commented 1 year ago

I'm not sure what you mean by "Spreadsheet," but if you mean our table, primary Term ID transportation from Rank Math to The SEO Framework is possible using Transport:

image

TSF has two methods to get the primary term:

$term    = tsf()->get_primary_term( $post_id, $taxonomy );
$term_id = tsf()->get_primary_term_id( $post_id, $taxonomy );

The second uses the first method but returns the term_id property when it's available.

If you want to see an example of how those can affect other plugins, the privately marked method _adjust_post_link_category() is used to filter:

https://github.com/sybrew/the-seo-framework/blob/fa24890943a257afe0b1b1940bd7ee44ccfffdb4/inc/classes/generate-url.class.php#L827-L844

Fox-Robinson commented 1 year ago

Regarding the spreadsheet, I am talking about WP ALL Export which exports posts to a CSV file. Yoast and Rank math fields are exported in this file automatically, whereas your plugin doesn't expose any of its fields to being exported so I cant use it. I'd be interested to know why it doesn't do that.

Fox-Robinson commented 1 year ago

And thank you for the info on accessing the primary term for posts.

sybrew commented 1 year ago

You should be able to add a Filter for _primary_term_{$taxonomy}, like _primary_term_category and _primary_term_product_cat, at the Export Template editor under Available Data -> Custom Fields.

Please note that TSF doesn't store this data if there's only one term selected for the post.

If you cannot find the settings, please get in touch with the authors of WP All Export about this.

sybrew commented 1 year ago

This proves more difficult than anticipated for bulk-edit:

  1. If "some" posts already have a category assigned, but they "all" get a new category, what will those "some" posts get assigned as primary?
  2. We must make clear which category is primary (#213) so that users can quickly spot what needs changing and if changes have been made successfully.

Moreover, the current admin quick-edit interface is too clunky, and this needs to be tested for accessibility, for which we have no more time for the v5.0 update.

So, I'm punting this to the next major release.

sybrew commented 1 month ago

We need this for the new Canonical URL Notation Tool in TSF v5.1, but we'll probably still postpone it to 5.2 or 5.1.x because we're running out of time for the impending release of WP 6.7.

Therefore, the Canonical URL won't respond to category changes in quick-edit -- everything else works as intended, however.