getCategoryBySlug( )

Gets a category by the specified slug.

The getCategoryBySlug() function returns a Promise that resolves to a category whose slug matches the specified slug.

The slug is the end of a category's URL that refers to a specific category. For example, if a category's URL is{my-category-slug}, the slug is my-post-slug. The slug is case-sensitive string that is generally derived from the category's label, unless specified otherwise.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Blog
Manage Blog
Read Draft Blog Posts
Learn more about permission scopes.
Method Declaration
Method Parameters

Slug of the category to retrieve.

The end of a category's URL. For example, 'https:/{my-category-slug}'. Case sensitive and generally based on the category label if not specified.


Options specifying which fields to return.

Return Type:Promise<GetCategoryBySlugResponse>
Was this helpful?