> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# UpdateBlogSettings

# Package: blog

# Namespace: BlogSettingsV3Service

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/blog/blog-settings/update-blog-settings.md

## Introduction

Updates the site's blog settings.

Each time the blog settings are updated, `revision` increments by 1. The current `revision` must be passed when updating the blog settings. This ensures you're working with the latest blog settings and prevents unintended overwrites.

Only fields included in the request are updated. To update comments, include `enabled`, `anonymousEnabled`, `ratingsEnabled`, and `ratingsMandatory` together.

Specify `language` to update `allPostsFeedLabel` for that language. When `language` is a secondary language, the primary label is left unchanged. An unsupported language is rejected.

---

## REST API

### Schema

```
 Method: updateBlogSettings
 Description: Updates the site's blog settings.  Each time the blog settings are updated, `revision` increments by 1. The current `revision` must be passed when updating the blog settings. This ensures you're working with the latest blog settings and prevents unintended overwrites.  Only fields included in the request are updated. To update comments, include `enabled`, `anonymousEnabled`, `ratingsEnabled`, and `ratingsMandatory` together.  Specify `language` to update `allPostsFeedLabel` for that language. When `language` is a secondary language, the primary label is left unchanged. An unsupported language is rejected.
 URL: https://www.wixapis.com/v3/blog-settings/v3/blog-settings
 Method: PATCH
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  blogSettings.revision
 Method parameters: 
   param name: blogSettings | type: BlogSettings | description: Blog settings control the label of the all-posts feed and whether visitors can comment. A site has one blog settings object.  
        - name: revision | type: string | description: Revision number, which increments by 1 each time the blog settings are updated. To prevent conflicting changes, the current revision must be passed when updating the blog settings. | required: true | read-only: true | validation: format int64
        - name: allPostsFeedLabel | type: string | description: Label of the feed that lists all posts.  Translatable. Specify `language` on Get Blog Settings or Update Blog Settings to read or write this label in a specific language.  Default: `All posts` when the site has no saved blog settings.  | validation: minLength 1, maxLength 35
        - name: comments | type: Comments | description: Comment settings for the blog.  When updating comments, include `enabled`, `anonymousEnabled`, `ratingsEnabled`, and `ratingsMandatory` together. A partial comments object is rejected.  
           - name: enabled | type: boolean | description: Whether comments are turned on for the blog.  Default: `true` when the site has no saved blog settings.  
           - name: anonymousEnabled | type: boolean | description: Whether visitors can comment without signing in.  Default: `false` when the site has no saved blog settings.  
           - name: ratingsEnabled | type: boolean | description: Whether visitors can rate a post when they comment.  Default: `false` when the site has no saved blog settings.  
           - name: ratingsMandatory | type: boolean | description: Whether a rating is required when a visitor leaves a comment.  Default: `false` when the site has no saved blog settings.  
   param name: language | type: language | description: Language of `allPostsFeedLabel` to update, in IETF BCP 47 language tag format. Typically, this is a lowercase 2-letter language code, followed by a hyphen, followed by an uppercase 2-letter country code. For example, `en-US` for U.S. English, and `de-DE` for Germany German.  When omitted, the primary language is updated. When the value is the site's primary language, the primary label is updated. When the value is a secondary language, only that language's label is updated.  | validation: format LANGUAGE_TAG
 Return type: UpdateBlogSettingsResponse
  - name: blogSettings | type: BlogSettings | description: Updated blog settings.  
     - name: revision | type: string | description: Revision number, which increments by 1 each time the blog settings are updated. To prevent conflicting changes, the current revision must be passed when updating the blog settings.  | read-only: true | validation: format int64
     - name: allPostsFeedLabel | type: string | description: Label of the feed that lists all posts.  Translatable. Specify `language` on Get Blog Settings or Update Blog Settings to read or write this label in a specific language.  Default: `All posts` when the site has no saved blog settings.  | validation: minLength 1, maxLength 35
     - name: comments | type: Comments | description: Comment settings for the blog.  When updating comments, include `enabled`, `anonymousEnabled`, `ratingsEnabled`, and `ratingsMandatory` together. A partial comments object is rejected.  
        - name: enabled | type: boolean | description: Whether comments are turned on for the blog.  Default: `true` when the site has no saved blog settings.  
        - name: anonymousEnabled | type: boolean | description: Whether visitors can comment without signing in.  Default: `false` when the site has no saved blog settings.  
        - name: ratingsEnabled | type: boolean | description: Whether visitors can rate a post when they comment.  Default: `false` when the site has no saved blog settings.  
        - name: ratingsMandatory | type: boolean | description: Whether a rating is required when a visitor leaves a comment.  Default: `false` when the site has no saved blog settings.  


```

### Examples

### Update the feed label and require a rating on comments
Updates the all-posts feed label and all four comment settings together.

```curl
curl -X PATCH \
'https://www.wixapis.com/v3/blog-settings' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "blogSettings": {
    "revision": "1",
    "allPostsFeedLabel": "All articles",
    "comments": {
      "enabled": true,
      "anonymousEnabled": false,
      "ratingsEnabled": true,
      "ratingsMandatory": true
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.blog.blogSettings.updateBlogSettings(options)
 Description: Updates the site's blog settings.  Each time the blog settings are updated, `revision` increments by 1. The current `revision` must be passed when updating the blog settings. This ensures you're working with the latest blog settings and prevents unintended overwrites.  Only fields included in the request are updated. To update comments, include `enabled`, `anonymousEnabled`, `ratingsEnabled`, and `ratingsMandatory` together.  Specify `language` to update `allPostsFeedLabel` for that language. When `language` is a secondary language, the primary label is left unchanged. An unsupported language is rejected.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  options.blogSettings.revision
 Method parameters: 
   param name: options | type: UpdateBlogSettingsOptions  none  
        - name: blogSettings | type: BlogSettings | description: Blog settings to update.  
           - name: revision | type: string | description: Revision number, which increments by 1 each time the blog settings are updated. To prevent conflicting changes, the current revision must be passed when updating the blog settings. | required: true | read-only: true | validation: format int64
           - name: allPostsFeedLabel | type: string | description: Label of the feed that lists all posts.  Translatable. Specify `language` on Get Blog Settings or Update Blog Settings to read or write this label in a specific language.  Default: `All posts` when the site has no saved blog settings.  | validation: minLength 1, maxLength 35
           - name: comments | type: Comments | description: Comment settings for the blog.  When updating comments, include `enabled`, `anonymousEnabled`, `ratingsEnabled`, and `ratingsMandatory` together. A partial comments object is rejected.  
              - name: enabled | type: boolean | description: Whether comments are turned on for the blog.  Default: `true` when the site has no saved blog settings.  
              - name: anonymousEnabled | type: boolean | description: Whether visitors can comment without signing in.  Default: `false` when the site has no saved blog settings.  
              - name: ratingsEnabled | type: boolean | description: Whether visitors can rate a post when they comment.  Default: `false` when the site has no saved blog settings.  
              - name: ratingsMandatory | type: boolean | description: Whether a rating is required when a visitor leaves a comment.  Default: `false` when the site has no saved blog settings.  
        - name: language | type: string | description: Language of `allPostsFeedLabel` to update, in IETF BCP 47 language tag format. Typically, this is a lowercase 2-letter language code, followed by a hyphen, followed by an uppercase 2-letter country code. For example, `en-US` for U.S. English, and `de-DE` for Germany German.  When omitted, the primary language is updated. When the value is the site's primary language, the primary label is updated. When the value is a secondary language, only that language's label is updated.  | validation: format LANGUAGE_TAG
 Return type: PROMISE<BlogSettings>
  - name: revision | type: string | description: Revision number, which increments by 1 each time the blog settings are updated. To prevent conflicting changes, the current revision must be passed when updating the blog settings.  | read-only: true | validation: format int64
  - name: allPostsFeedLabel | type: string | description: Label of the feed that lists all posts.  Translatable. Specify `language` on Get Blog Settings or Update Blog Settings to read or write this label in a specific language.  Default: `All posts` when the site has no saved blog settings.  | validation: minLength 1, maxLength 35
  - name: comments | type: Comments | description: Comment settings for the blog.  When updating comments, include `enabled`, `anonymousEnabled`, `ratingsEnabled`, and `ratingsMandatory` together. A partial comments object is rejected.  
     - name: enabled | type: boolean | description: Whether comments are turned on for the blog.  Default: `true` when the site has no saved blog settings.  
     - name: anonymousEnabled | type: boolean | description: Whether visitors can comment without signing in.  Default: `false` when the site has no saved blog settings.  
     - name: ratingsEnabled | type: boolean | description: Whether visitors can rate a post when they comment.  Default: `false` when the site has no saved blog settings.  
     - name: ratingsMandatory | type: boolean | description: Whether a rating is required when a visitor leaves a comment.  Default: `false` when the site has no saved blog settings.  


```

### Examples

### Update the feed label and require a rating on comments
Updates the all-posts feed label and all four comment settings together.

```javascript
import { blogSettings } from "@wix/blog";

async function updateBlogSettings() {
  const response = await blogSettings.updateBlogSettings({
    blogSettings: {
      revision: "1",
      allPostsFeedLabel: "All articles",
      comments: {
        enabled: true,
        anonymousEnabled: false,
        ratingsEnabled: true,
        ratingsMandatory: true,
      },
    },
  });
}

/* Promise resolves to:
 * {
 *   "revision": "2",
 *   "allPostsFeedLabel": "All articles",
 *   "comments": {
 *     "enabled": true,
 *     "anonymousEnabled": false,
 *     "ratingsEnabled": true,
 *     "ratingsMandatory": true
 *   }
 * }
 */

```

### updateBlogSettings (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { blogSettings } from '@wix/blog';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { blogSettings },
  // Include the auth strategy and host as relevant
});


async function updateBlogSettings(options) {
  const response = await myWixClient.blogSettings.updateBlogSettings(options);
};
```

---