Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcodes not converted in rendered meta description and schema's #22

Closed
CodeBradley opened this issue Oct 25, 2020 · 2 comments
Closed
Labels
Abandoned question Further information is requested

Comments

@CodeBradley
Copy link

CodeBradley commented Oct 25, 2020

Describe the bug
I have a [company] shortcode that dynamically converts into the business name set on my websites. When I use the [company] shortcode within my WooCommerce product category meta descriptions it gets indexed on Google with the actual shortcode, [company], instead of my actual business name.

A matter of fact, I'm not seeing the meta description inserted throughout my website at all now for some reason; so I can't show a screenshot of that. I don't want that to distract from the problem at hand, but ideally I would like to know how to fix both issues if one of the dev's or a knowledgeable community member could assist.

Thanks guy, loving the plugin so far. It's a better approach than Yoast SEO in the Elementor context for sure.

To Reproduce
Steps to reproduce the behavior:

  1. Setup WooCommerce category
  2. Add meta description's to it using plugin
  3. Check the meta description with inspector
  4. ???
  5. Profit

Expected behavior
A clear and concise description of what you expected to happen.

I expected the shortcode to be ran through do_shortcode function to convert it to my company name.

Screenshots
Screen Shot 2020-10-24 at 8 06 07 PM

Desktop (please complete the following information):

  • OS: macOS
  • Browser: chrome
  • Version: 86.0.4240.111 (Official Build) (x86_64)

Additional context
Add any other context about the problem here.

Side Note: An additional feature I personally would like to see would be for WooCommerce categories built with Elementor's Theme Builder to have the SEO tab in the editor instead, or on top, of us having to go into the actual WooCommerce category.

@surajv
Copy link
Contributor

surajv commented Oct 25, 2020

Hi @CodeBradley,

We intentionally stripe shortcodes from the metadata as many shortcodes print HTML, which breaks the front-end design.

If you want to use shortcodes in the metadata, please try the below filter in your theme's functions.php file or using the Code Snippets plugin.

https://rankmath.com/kb/filters-hooks-api-developer/#allow-shortcodes

/**
 * Allow shortcodes in the Meta Data.
 */
add_filter( 'rank_math/paper/auto_generated_description/apply_shortcode', '__return_true' );

For WooCommerce Products

/**
* Filter to allow shortcodes in the Product schema description.
*/
add_filter( 'rank_math/product_description/apply_shortcode', '__return_true' );

@surajv surajv added Abandoned question Further information is requested labels Dec 12, 2020
@surajv
Copy link
Contributor

surajv commented Dec 12, 2020

Closing it for inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Abandoned question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants