Custom Meta Description - auto generated | Configuring All in One SEO Pack Pro | Support | Semper Plugins

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

No permission to create posts
sp_Feed Topic RSS sp_TopicIcon
Custom Meta Description - auto generated
May 3, 2017
1:39 am
Avatar
Deb Harris-Humeniuk
Member
AIOSEOP
Forum Posts: 28
Member Since:
May 1, 2017
sp_UserOfflineSmall Offline

Hi

I need help/detailed instructions with creating a custom auto generated meta description for the woocommerce store I am developing on my local computer. (sorry cant provide url – its not online)  I had originally started discussions here: 

https://wordpress.org/support/topic/woocommerce-custom-meta-description-sku/

(we’re happy to provide higher levels of support for customers, including helping to write custom functions (within reason) using our API)

and based on that, purchased All-in One Seo Pro.  At this time, I dont understand api filter hooks – at all.

What I need is a custom auto-generated meta description (limited to 160 characters) for my product pages in this format:

Product title – sku – Product description

Background – my oscommerce store that I am converting over to woocommerce has 17000 products – the majority of these products are very similar with one graphic and then over 100 different dog breed images put on that graphic – creating 100 different product pages, etc.  I try, but I can only make the descriptions so unique and the above gives me a lot of leeway as the sku and product title is always different.

May 3, 2017
9:27 am
Avatar
Michael Torbert
Admin
Forum Posts: 350
Member Since:
October 13, 2011
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

May 3, 2017
10:01 am
Avatar
Deb Harris-Humeniuk
Member
AIOSEOP
Forum Posts: 28
Member Since:
May 1, 2017
sp_UserOfflineSmall Offline

Thanks !  I added via code snippets plugin – thats handy 🙂

The above filter adds the title and the sku but it leaves the description blank?  I tried on an existing product and added a new product ?

As well, should the character count update ?  its still at 0

Screen shot attachedMissing-Description.jpgImage Enlarger

sp_PlupAttachments Attachments
May 3, 2017
10:10 am
Avatar
Steve Mortiboy
Admin
Forum Posts: 1787
Member Since:
January 5, 2012
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

May 3, 2017
10:19 am
Avatar
Deb Harris-Humeniuk
Member
AIOSEOP
Forum Posts: 28
Member Since:
May 1, 2017
sp_UserOfflineSmall Offline

I want the woocommerce product description – please take a look at my screen shot.  I have a description “This is my test product 3” entered for the product at the top of the red arrow, but it is not appearing in the meta description area.

May 3, 2017
10:53 am
Avatar
Steve Mortiboy
Admin
Forum Posts: 1787
Member Since:
January 5, 2012
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

May 3, 2017
11:01 am
Avatar
Deb Harris-Humeniuk
Member
AIOSEOP
Forum Posts: 28
Member Since:
May 1, 2017
sp_UserOfflineSmall Offline

you rock !  Thats perfect !

Thank you so much !

May 4, 2017
8:01 am
Avatar
Deb Harris-Humeniuk
Member
AIOSEOP
Forum Posts: 28
Member Since:
May 1, 2017
sp_UserOfflineSmall Offline

Im sorry, I spoke too soon – it works perfectly but this does not truncate to 160 characters ? –  (I added a lot more text to the description and when I view the actual page source for the product page – the whole description is there) (The preview snippet in the admin seo section looks perfect – but this is not what is actually appearing in the actual product page source) which is going to cause errors in google for a long description- isnt it ?.  How would I get the auto generated meta description to truncate to 160 ? and is there a way to strip extra blank spaces ?

May 4, 2017
9:35 am
Avatar
Michael Torbert
Admin
Forum Posts: 350
Member Since:
October 13, 2011
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

May 4, 2017
10:00 am
Avatar
Deb Harris-Humeniuk
Member
AIOSEOP
Forum Posts: 28
Member Since:
May 1, 2017
sp_UserOfflineSmall Offline

Thanks – that does truncate it to less that 160 characters.  It doesnt remove blank spaces or tabs but I think this will be great. I will be doing further testing before importing my 17000 products.  Thanks so much for all your help and patience !

May 4, 2017
10:47 am
Avatar
Michael Torbert
Admin
Forum Posts: 350
Member Since:
October 13, 2011
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

May 4, 2017
2:57 pm
Avatar
Deb Harris-Humeniuk
Member
AIOSEOP
Forum Posts: 28
Member Since:
May 1, 2017
sp_UserOfflineSmall Offline

That seems to have fixed it.  Thanks so much !  This looks like it will be great ! Thanks again !

May 17, 2017
1:27 am
Avatar
Deb Harris-Humeniuk
Member
AIOSEOP
Forum Posts: 28
Member Since:
May 1, 2017
sp_UserOfflineSmall Offline

Working further on the set up of my new store (slow going being so new to woocommerce). 

The custom auto generated meta description above (works great on the product pages !) – but I just intended it for the product pages.  I just noticed that the same auto generated meta description format is being generated for the product Category pages and the Shop page as well. 

I have manually entered the meta description in the SEO section on the Category pages but when I view the page source – the meta description is taking the format above from some product within the product category.  

The meta description on my other regular wordpress pages is working as it should (I manually put my description in the seo area and that is what is appearing in the page source)

Is there a way to have this not happen or is there a setting I should be checking ?  I havent been able to check the home page because I havent done anything on that yet.

May 23, 2017
11:28 am
Avatar
Michael Torbert
Admin
Forum Posts: 350
Member Since:
October 13, 2011
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

March 14, 2018
2:49 pm
Avatar
web
Member
AIOSEOP
Forum Posts: 8
Member Since:
March 14, 2018
sp_UserOfflineSmall Offline

Hi,

Sorry to bring up an old post, but I have recently paid for AIOSEO Pro and would like to do the same thing here, but for WooCommerce Product Titles. 

Ideally the new title would be = “$title – $sku”. 

 

Can you help please? 

Thanks!

March 14, 2018
2:53 pm
Avatar
Michael Torbert
Admin
Forum Posts: 350
Member Since:
October 13, 2011
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

March 14, 2018
2:57 pm
Avatar
web
Member
AIOSEOP
Forum Posts: 8
Member Since:
March 14, 2018
sp_UserOfflineSmall Offline

Ok, so this is the code that I tried previously, and I think I must’ve done something wrong as it doesn’t work for me. 

 

add_filter( ‘aioseop_title’, ‘aioseop_mod_wc_title’, 10, 1 );

function aioseop_mod_wc_title( $original_title ){
// Product title – sku – Product description.
$sku = ”;
$title = ”;

global $post;
if( ‘product’ !== $post->post_type || ! is_single() ){
return $original_title;
}
$title = $post->post_title;

$sku = get_post_meta($post->ID, ‘_sku’, true);

$meta_title = "$title – $sku";

$aio = new All_in_One_SEO_Pack;
$meta_title = $aio->trim_excerpt_without_filters( $meta_title );

return $meta_title;
}

 

I basically removed “description” and replaced with “title” in all instances, but I’m not getting the SKU in the title field. 

Thanks!

March 14, 2018
3:15 pm
Avatar
Michael Torbert
Admin
Forum Posts: 350
Member Since:
October 13, 2011
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

March 14, 2018
3:30 pm
Avatar
web
Member
AIOSEOP
Forum Posts: 8
Member Since:
March 14, 2018
sp_UserOfflineSmall Offline

I just tried this from one of your earlier iterations within this thread, and still couldn’t get it to work

add_filter( ‘aioseop_title’, ‘aioseop_mod_wc_title’, 10, 1 );

function aioseop_mod_wc_title( $original_title ){
// Product title – sku – Product description.

$sku = ”;
$title = ”;

global $post;
if( ‘product’ !== $post->post_type ){
return $original_title;
}
$title = $post->post_title;

$sku = get_post_meta($post->ID, ‘_sku’, true);

$meta_title = "$title – $sku";

return $meta_title;
}

March 14, 2018
3:33 pm
Avatar
web
Member
AIOSEOP
Forum Posts: 8
Member Since:
March 14, 2018
sp_UserOfflineSmall Offline

I actually just tried your code from the previous message and that caused the site to stop responding. To clarify (I don’t think I did earlier), I would like to use the description function in this post (that works correctly) AND the title function (just adding the SKU to title).

Thanks

No permission to create posts
Forum Timezone: America/New_York

Most Users Ever Online: 964

Currently Online:
16 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Member Stats:

Guest Posters: 35

Members: 18937

Moderators: 0

Admins: 8

Forum Stats:

Groups: 4

Forums: 28

Topics: 1823

Posts: 7736

Newest Members:

Ira Block

Administrators: Michael TorbertPeter BayliesSupport TeamSteve MortiboyMatthew RobinsonSteve KlasenArnaud BroesAsh R

[i]
[i]
Skip to toolbar