Need help?

Paid user: Create A Ticket

Free user: Visit Support Forums

Related Docs

Back To Docs

Shortcodes

Updated on January 27, 2023

You can add shortcodes to the content area of any page or post in order to display specific content. For more on shortcodes and how to use them, please see WordPress Codex: Shortcodes.

Sensei provides the following shortcodes:

Courses

A list of courses.

[sensei_courses]
OptionDescriptionValuesDefault
categoryShow courses from a specific categoryAny valid course category ID, slug, or term namenone (all categories)
excludeSpecific course(s) to exclude from displayAny valid course ID(s) (comma separated)none
idsSpecific course(s) to displayAny valid course ID(s) (comma separated)none (all courses)
numberNumber of courses to displayAny valid number10
orderSort orderasc, descdesc (asc when orderby is menu_order)
orderbyHow to order the coursesAny orderby parameter found heredate
teacherShow courses from specific teacher(s)Any valid user ID(s) or user name(s) (comma separated)none (all teachers)

Example

[sensei_courses category="music" exclude="23" number="10" order="asc" orderby="name" teacher="123"]

Featured Courses

A list of featured courses.

[sensei_featured_courses]

Options

OptionDescriptionValuesDefault
numberNumber of featured courses to displayAny valid number10
orderSort orderasc, descdesc (asc when orderby is menu_order)
orderbyHow to order the coursesAny orderby parameter found heredate
teacherDisplay only courses by a specific teacherUser ID or user namenone (all teachers)

Example

[sensei_featured_courses number="5" order="asc" orderby="name" teacher="123"]

Courses by User

A list of courses the currently logged in user is taking.

[sensei_user_courses]  

Options

OptionDescriptionValuesDefault
numberNumber of courses to display per pageAny valid number10
orderSort orderasc, descasc
orderbyHow to order the coursesAny orderby parameter found heretitle
statusWhether to display active or completed coursesactive, completeno status (displays both active and completed)

Example

[sensei_user_courses number="5" order="desc" orderby="name" status="complete"]

Teachers


A list of users with the teacher role, displayed as links to their author archive page.

[sensei_teachers]

Options

OptionDescriptionValuesDefault
excludeTeachers to excludeAny valid user IDs or user names (comma separated)none (display all teachers)
includeTeachers to includeAny valid user IDs or user names (comma separated)none (display all teachers)

Example

[sensei_teachers exclude="23"]

User Messages

A list of private Sensei messages for the current user.

[sensei_user_messages]

Options

There are no options for this shortcode.

Course Page


Display the content of a specific course page by course ID.

[sensei_course_page]
OptionDescriptionValuesDefault
id (required)The ID of the course to displayAny valid course IDnone

Example

[sensei_course_page id="123"]

Course Categories

A list of course categories.

[sensei_course_categories]

Options

OptionDescriptionValuesDefault
excludeSpecific course categories to excludeAny valid course category ID, slug, or term name (comma separated)none (display all)
hide_emptyDisplay only categories containing at least one coursetrue, falsefalse
includeSpecific course categories to displayAny valid course category ID, slug, or term name (comma separated)none (display all)
numberNumber of categories to displayAny valid number100
orderSort orderasc, descasc
orderbyHow to order the categoriesAny orderby parameter found herename
parentDisplay only categories with a specific parentAny valid course category ID. To show only top-level categories, set parent="0".none (display all)

Example

[sensei_course_categories exclude="music" hide_empty="true" order="desc" orderby="slug"]

Unpurchased Courses


A list of all courses linked to a WooCommerce product that the current user has not yet purchased.

[sensei_unpurchased_courses]

Options

OptionDescriptionValuesDefault
numberNumber of courses to displayAny valid number10
orderSort orderasc, descdesc (asc when orderby is menu_order)
orderbyHow to order the coursesAny orderby parameter value found heretitle

Example

[sensei_unpurchased_courses number="5" order="asc" orderby="date"]

Legacy Shortcodes

The following shortcodes were deprecated in Sensei 1.9 and should no longer be used:

[newcourses] – Displays the latest courses.

[featuredcourses] – Displays the courses marked as featured.

[freecourses] – Displays courses that do not require payment to take.

[paidcourses] – Displays courses that require payment to take.

[usercourses] – Displays the user’s active/completed courses or a login/register form if they are not logged in.

Finding the ID

In order to find the course ID to use for the [sensei_courses] or [sensei_course_page] shortcode, go to Courses > All Courses and edit the course you want to use. The URL will show a number that is the ID for your course (in the screenshot below, the course ID is 7707).
sensei-courseid

You can use a similar technique to find the course category ID or teacher ID.