How to Use WPS Insert Code Block on Windows

Last updated:July 23, 2026

This how-to guide includes 4 operation topics, all available without membership, so you can insert and adjust code blocks from the index below.

How-to Index

How-to Guide

1. Add a code block from the Insert menu

Entry path: Insert → Code Block

  1. Place the cursor where you want to insert the code block.
  2. Click the Insert tab on the ribbon.
  3. Select Code Block.
  4. Type your code in the new block.

Success Criteria

  • Interface result: a separate code block appears at the current cursor position.
  • What you can do next: you can continue typing, pasting, or editing code inside the block.

Tips While Using

  • Common mistake: if the cursor is not placed in the target location first, the block may be inserted in a different paragraph area.

2. Insert a code block with slash commands

Entry path: Paragraph input → / → Code Block

  1. Type / in a paragraph to open the quick menu.
  2. Type 代码块 or code to search.
  3. Select the code block option from the list.
  4. Enter your content in the inserted block.

Success Criteria

  • Interface result: the quick menu shows a code block option, and selecting it creates the block.
  • What you can do next: you can start entering code immediately without switching to another menu.

Tips While Using

  • Common mistake: if you type only the slash and do not continue with a keyword, the menu may show too many options.

3. Insert a code block from the paragraph plus button

Entry path: Plus button beside a paragraph → Code Block

  1. Place the cursor near the position where you want to insert the block.
  2. Click the + button beside the paragraph.
  3. Find Code Block in the menu.
  4. Click it to finish insertion.

Success Criteria

  • Interface result: a new code block appears near the target paragraph.
  • What you can do next: you can enter code or continue adjusting the block position.

Tips While Using

  • Common mistake: if the pointer is not near the paragraph area, the plus button may not appear right away.

4. Adjust code block settings

Entry path: Top of the code block → Language / Fixed Height / Settings

  1. Insert a code block first.
  2. Click the language name at the top left of the block to switch languages.
  3. Choose Fixed Height or Fit Content based on your needs.
  4. Open Settings and turn Wrap on or off.
  5. Turn Dark Theme on or off for reading preference.

Success Criteria

  • Interface result: the top area of the code block shows the current language and setting status.
  • What you can do next: you can keep editing and viewing the block with the selected language and display mode.

Tips While Using

  • Common mistake: if the block is not selected or focused first, the top controls may be less obvious.