Title: Sidebars
Published: April 26, 2023
Last modified: January 16, 2024

---

# Sidebars

## In this article

 * [Schema](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#schema)
 * [Retrieve a Sidebar](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#retrieve-a-sidebar)
    - [Definition & Example Request](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#definition-example-request)
    - [Arguments](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#arguments)
 * [Retrieve a Sidebar](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#retrieve-a-sidebar-2)
    - [Definition & Example Request](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#definition-example-request-2)
    - [Arguments](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#arguments-2)
 * [Update a Sidebar](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#update-a-sidebar)
    - [Arguments](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#arguments-3)
    - [Definition](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#definition)
    - [Example Request](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#example-request)

[ Back to top](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#wp--skip-link--target)

## 󠀁[Schema](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#schema)󠁿

The schema defines all the fields that exist within a sidebar record. Any response
from these endpoints can be expected to contain the fields below unless the `_filter`
query parameter is used or the schema field only appears in a specific context.

 |   `id`  |   ID of sidebar.

 JSON data type: string

Read only

Context: `embed`, `view`, `edit`

  |  
 |   `name`  |   Unique name identifying the sidebar.

 JSON data type: string

Read only

Context: `embed`, `view`, `edit`

  |  
 |   `description`  |   Description of sidebar.

 JSON data type: string

Read only

Context: `embed`, `view`, `edit`

  |  
 |   `class`  |   Extra CSS class to assign to the sidebar in the Widgets interface.

 JSON data type: string

Read only

Context: `embed`, `view`, `edit`

  |  
 |   `before_widget`  |   HTML content to prepend to each widget's HTML output when assigned to this sidebar. Default is an opening list item element.

 JSON data type: string

Read only

Context: `embed`, `view`, `edit`

  |  
 |   `after_widget`  |   HTML content to append to each widget's HTML output when assigned to this sidebar. Default is a closing list item element.

 JSON data type: string

Read only

Context: `embed`, `view`, `edit`

  |  
 |   `before_title`  |   HTML content to prepend to the sidebar title when displayed. Default is an opening h2 element.

 JSON data type: string

Read only

Context: `embed`, `view`, `edit`

  |  
 |   `after_title`  |   HTML content to append to the sidebar title when displayed. Default is a closing h2 element.

 JSON data type: string

Read only

Context: `embed`, `view`, `edit`

  |  
 |   `status`  |   Status of sidebar.

 JSON data type: string

Read only

Context: `embed`, `view`, `edit`

 One of: `active`, `inactive`

 |  
 |   `widgets`  |   Nested widgets.

 JSON data type: array

Context: `embed`, `view`, `edit`

  |

## 󠀁[Retrieve a Sidebar](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#retrieve-a-sidebar)󠁿

### 󠀁[Definition & Example Request](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#definition-example-request)󠁿

 `GET /wp/v2/sidebars`

 Query this endpoint to retrieve a specific sidebar record.

 `$ curl https://example.com/wp-json/wp/v2/sidebars`

### 󠀁[Arguments](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#arguments)󠁿

 |   `context`  |   Scope under which the request is made; determines fields present in response.

 Default: `view`

 One of: `view`, `embed`, `edit`

 |

## 󠀁[Retrieve a Sidebar](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#retrieve-a-sidebar-2)󠁿

### 󠀁[Definition & Example Request](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#definition-example-request-2)󠁿

 `GET /wp/v2/sidebars/<id>`

 Query this endpoint to retrieve a specific sidebar record.

 `$ curl https://example.com/wp-json/wp/v2/sidebars/<id>`

### 󠀁[Arguments](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#arguments-2)󠁿

 |   `id`  |   The id of a registered sidebar  |  
 |   `context`  |   Scope under which the request is made; determines fields present in response.

 Default: `view`

 One of: `view`, `embed`, `edit`

 |

## 󠀁[Update a Sidebar](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#update-a-sidebar)󠁿

### 󠀁[Arguments](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#arguments-3)󠁿

 |   `[widgets](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#schema-widgets)`  |   Nested widgets.  |

### 󠀁[Definition](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#definition)󠁿

 `POST /wp/v2/sidebars/<id>`

### 󠀁[Example Request](https://developer.wordpress.org/rest-api/reference/sidebars/?output_format=md#example-request)󠁿

First published

April 26, 2023

Last updated

January 16, 2024

Edit article

[ Improve it on GitHub: Sidebars ](https://github.com/WP-API/docs/edit/master/reference/sidebars.md)

Changelog

[ See list of changes: Sidebars ](https://github.com/WP-API/docs/commits/master/reference/sidebars.md)

[  Previous: Search Results](https://developer.wordpress.org/rest-api/reference/search-results/)

[  Next: Site Settings](https://developer.wordpress.org/rest-api/reference/settings/)