Yes, there’s many ways to do it,
You must add parameters to the function to override default value, first parameter must be empty
the_tags( '' );
echo '<meta itemprop="keywords" content="'. the_tags( '') .''"/>';
There is also wp_get_post_terms()
function if you want more control,
Create a function in functions.php
function wpse_get_tags(){
global $post;
$term_list = wp_get_post_terms($post->ID, 'post_tag', array("fields" => "all"));
foreach($term_list as $term_single) {
$tags .= $term_single->name .', '; // do the job to remove last comma
}
return $tags;
}
In your code
echo '<meta itemprop="keywords" content="''.wpse_get_tags().''"/>';
Related Posts:
- Is There a Difference Between Taxonomies and Categories?
- How to display non-hierarchical taxonomy as terms with checkboxes?
- Control term order on a per-post basis
- Any way to assign Post Categories and Tags to Links?
- Search Posts / Pages with multiple options?
- How to “group” (categorize) the Pages together?
- Is There a Difference Between Taxonomies and Categories?
- Echo text using is_tag
- Automatically adding tags and categories into Post Excerpt for searching
- Filtering posts in category by tag URL
- Can’t custom taxonomies have same terms (slugs) as categories?
- get_categories for custom post type with a specific custom taxonomy attached
- How do the ‘tag’ and ‘category’ (default) taxonomies do ‘save_post’ action?
- Could not insert term into the database
- Checklist of selected categories
- Weird behaviour when adding terms/term_taxonomies programmatically
- Sort posts by tags in category pages
- How to search for categories and/or tags?
- How to get the url to tag & category base set by the user?
- Filter categories using tags
- Sticky posts on home page, search, tag and archives without plugin
- In the tag archive – display count of posts for each category they belong to
- Is it possible to disable certain user roles from creating tags?
- Root level category, tag, author and archive pages to work
- Wrap a chosen category name with div
- Remove Categories and Tags from Admin Dashboard
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- What’s the difference between “parent” and “category_parent” in a WP_Term object?
- Update taxonomy value of post type in query
- Display name of the last child category
- Hide tag and category boxes from the post editor
- Categories: A Greenhorn Question on Strategy (Not Code)
- How to view WordPress’ default category IDs?
- Random taxonomy category list
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- Making a tourism information website [closed]
- Changing permalink from /postname/ to category/postname/
- Show Available Taxonomy List with Current Category
- Exclude a category from the_category in the single post page
- Why does the argument list_only do on Walker_Category_Checklist::start_el?
- Site search needs to find posts for category topic AND Tag or keyword thats not in the post
- Pagination is not working properly in Product Category/Tag pages
- Drop posts from categories in MySql
- Customize category page for different custom taxonomies
- Get posts under a category with SQL
- Display custom taxonomy attached to the post on post single page
- Admin: Navigation Menus do not show empty categories/taxonomies in the list’s search tab
- How to Remove a Title from All Category and Tags Page?
- Need help deciding on a taxonomy
- Display sibling categories on category page
- Get Posts by Category, Tag , and CPT Taxonomy
- How can I display tags as categories?
- WP 4.7 in_category change?
- Get posts of a custom post type from category from taxonomy?
- Illegal string offset ‘taxonomy’ in
- Change categories count to include media attachments
- How to get selected taxonomy or category ID if using custom walker?
- Let user select their own category
- How to store category and tags separatly on wordpress?
- Setting selected term_id with wp_dropdown_categories?
- Custom post type, taxonomy and admin bar
- post_class remove tag- or category- from slug
- creating categories programmatically
- sidebar troubles, taxonomy trouble
- Displaying posts of given category
- display specific category when website loads
- WordPress Default Category and Custom Taxonomy Selected Attribute not Working After Searched in wp_dropdown_categories Array
- Show subChild categories
- Return all Tags and Categories in Separate List
- How can i change sort category view starting from child then parent, not alphabetically
- WordPress 5.4 and higher: Filter posts by category 1 AND category 2 in API requests
- Multiple Tag Filtering
- get taxonomies from terms
- WordPress Portofolio Conditional Templating – functions php
- Get WooCommerce product category list in functions.php
- Automatically create tags and merge with categories
- How to assign Categories and tags inside the TinyMCE Editor for each Image?
- outputting taxonomy hierarchy
- Confused about category.php template – not working
- Why use hierarchical taxonomies instead of many custom taxonomies?
- custom browse by
- Search by tag, category and author without plugin
- Limit Category/Tag Dropdown To blog_id in Multisite Install With Global Categories/Tags
- Tag Menu items based on their categories
- How to Manage and link certain custom taxonomy?
- How to add an “All” category to the tag cloud?
- Display Taxonomies in loop with template args
- Grouping parent categories into sections
- Unable to get all tags from specific categories
- Match two taxonomies to display a specific content
- altering theme – content generated by PAGES not PORTFOLIO
- Display only the latest post
- Return selected categories only in custom page meta box?
- get IDs from links categories
- Multiple Parent Category URLs
- Chained drop-down menu for custom taxonomy using chained.js
- Display only one level subcategory in wordpress
- Converting Categories (with ACF fields) to custom taxonomies
- Taxonomy term RestApi data 10 rows limitions
- Quick Edit on taxonomy names results in error