3

In SharePoint online I renamed a few terms couple of weeks ago. I'm pretty sure the timer job that should clean it up has run but it still shows as the old one - for old and new documents alike.

How do I make sure they are renamed? What do I need to do?

1 Answer 1

3

There are two things you need to think about when updating terms. First is the actual term on the list item, and the second is optional if you have managed metadata refiners, and that is to update the term in the index (the old value will show up in your refiners even if you fix the first issue).

To Update Terms on list, here's a PowerShell script you can use (leverages PnP-Powershell), but the most important item is the last line where you call UpdateUsedTermsOnSite...

Connect-PnPOnline -Url "<https://XXXX.sharepoint.com/sites/thesite>" -Interactive
$tax = Get-PnPTaxonomySession
Get-PnPProperty -ClientObject $tax -Property "TermStores"
$ts = $tax.TermStores[0]
$site = Get-PnPSite
$ts.UpdateUsedTermsOnSite($site)
Invoke-PnPQuery
# and wait a few minutes...

To update the index so the content, you may need to force a reindex of the content if no other changes were made.

4
  • Thanks James, I might try that next time I'm updating terms but I resolved it by contacting Office365 support and they did run some scripts - perhaps the one you wrote. Apologies but the support wasn't very forthcoming and I wasn't able to get much information from them.
    – JurajB
    Feb 25, 2018 at 23:58
  • I did try this on sharepoint online but it didnt do anything. This is all I got: Name Id Groups KeywordsTermSet ---- -- ------ --------------- Taxonomy_jhulJ+zYxefXr4Zzm5Tvzg== afa4d59c-aa6c-4938-b678-8b4a639f4f9d Not loaded Not loaded
    – Alberto S.
    Jan 23, 2020 at 12:10
  • 1
    You need an Invoke-PnPQuery on the end of that snippet
    – James Love
    May 27, 2021 at 9:48
  • I edited this answer to include the (needed) call to Invoke-PnPQuery (as per @JamesLove's comment) and give a complete working script sample.
    – Evariste
    Oct 10, 2023 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.