the-seo-framework icon indicating copy to clipboard operation
the-seo-framework copied to clipboard

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

Open sybrew opened this issue 5 years ago • 13 comments

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.

sybrew avatar Mar 01 '20 21:03 sybrew

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

Fox-Robinson avatar Aug 13 '23 13:08 Fox-Robinson

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.

sybrew avatar Aug 14 '23 16:08 sybrew

Hi there,

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

Fox-Robinson avatar Aug 14 '23 17:08 Fox-Robinson

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. 🤷

sybrew avatar Aug 14 '23 17:08 sybrew

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

Fox-Robinson avatar Aug 14 '23 18:08 Fox-Robinson

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.

sybrew avatar Aug 14 '23 18:08 sybrew

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.

Fox-Robinson avatar Aug 15 '23 07:08 Fox-Robinson

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:

  • post_link_category
  • wc_product_post_type_link_product_cat
  • woocommerce_breadcrumb_main_term
  • woocommerce_product_categories_widget_main_term

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

sybrew avatar Aug 21 '23 05:08 sybrew

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 avatar Aug 21 '23 09:08 Fox-Robinson

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

Fox-Robinson avatar Aug 21 '23 09:08 Fox-Robinson

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 avatar Aug 21 '23 11:08 sybrew

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 avatar Nov 10 '23 06:11 sybrew