top of page

Automate Your Sitecore Dictionary Entries with PowerShell

  • Writer: Cristina Paolillo
    Cristina Paolillo
  • Jun 19, 2024
  • 1 min read

Updated: Dec 18, 2024

Are you looking to streamline your dictionary entries in Sitecore? Use this PowerShell script designed to simplify bulk insertions and updates.

Here’s how you can use it:


Preparing Your CSV File

Start by creating a CSV file with the following columns:

  • path: The parent item path (e.g., /sitecore/content/<Site Collection>/<Site>/Dictionary/<Parent Folder Path>)

  • name: Dictionary item name

  • key: Dictionary key field

  • value: Dictionary phrase field

  • lang: Language


You can download a sample CSV from this link.



How the Script Works

Each entry in your CSV corresponds to a dictionary entry to be inserted or updated:

  • If the specified path doesn't exist, the script will create it recursively.

  • If the dictionary item already exists, it will be updated while retaining the previous version.


Uploading to Media Library

Once your CSV file is ready:

  1. Navigate to the media library item at /sitecore/media library/Dictionary (or any preferred path) and upload the file. Just remember to update the file path in the script accordingly.

  2. For future updates, click on "Attach" and update the item with your newly created CSV.


Running the Script and Verifying Results

  1. Access PowerShell ISE from the utilities

  2. Copy the script below

  3. Click on "Execute" to run the script



Dictionary Bulk Insert Script execution
Dictionary Bulk Insert Script execution

After execution, verify the correct insertion of dictionary labels.

By following these steps, you can efficiently manage your dictionary entries in Sitecore.


Happy scripting!



Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page