Skip to main content
All CollectionsNFTs
How to remove the .json file extensions when uploading your NFT Metadata to IPFS
How to remove the .json file extensions when uploading your NFT Metadata to IPFS

How to get your NFT metadata to appear by removing your .json extensions

Lisa Kilker avatar
Written by Lisa Kilker
Updated over a year ago

Congrats! You have successfully uploaded your files to Pinata and they are now on the IPFS network. However, despite pointing your .json file (which contains all the metadata regarding your NFT) to your content, your images aren’t appearing on the NFT marketplace.

Metadata Example (OpenSea)

source: <a href="https://docs.opensea.io/docs/metadata-standards" target="_blank" rel="nofollow noopener noreferrer">https://docs.opensea.io/docs/metadata-standards</a>

Why are my NFTs not appearing?

If your metadata IPFS link ends with .json, then you might have missed a step. Some smart contracts will include a file extension that will be tacked onto the token ID in combination to the Base URI. Such a feature would like like this in the smart contract:

string public baseExtension = “.json”

As a result your tokenURI is appearing as:

ipfs://<directory_hash>/<tokenID>.json

However, there are other smart contracts that do not have this extension and instead just have the file name and the “.json” file extension is removed completely, which would look like this:

ipfs://<directory_hash>/<tokenID>

How can I fix this?

There are two options to fix this:

  1. Rewrite the smart contract to include the .json file extension modifying

  2. Remove the file extensions from your json files

Because IPFS is immutable, and removing the file extensions would change the CID, you would need to re-upload them and update the base URI. If your smart contract does not have a function to do that then you would need to redeploy the smart contract.

Here are some methods to remove the file extensions from your json files!

For Mac OS users:

  1. Go to Finder on your Mac

  2. Click “Finder” at the top in the toolbar

  3. Click “Settings”

  4. Click “Advanced”

  5. Check the box that says “Show all filename extensions”

  6. Uncheck the box that says “Show warning before changing an extension”

  7. Go to the folder on your computer which contains all your .json files

  8. Highlight all the files

  9. Right click and select “rename”

  10. Under “Find” enter “.json” (leave “Replace with” blank)

  11. Click “rename”

DON’T FORGET: Now that you’ve removed the .json file extensions, you will need to re-upload your files to the IPFS network!

For PC users:

  1. Open your "File Explorer Options"

  2. Click the "View" tab

  3. Uncheck the box for "Hide extensions for known file types"

  4. Click "Apply"

  5. Go to your "Command Prompt"(CMD) Note: Be sure you're under your administrator login. To be sure, you can "right click" on the app itself and select "Run as administrator"

  6. Go back to your folder which contains your files and copy the file path

  7. Go back to your CMD window and type: cd <paste copied link here>

  8. Hit "enter" and you will now be inside of that folder directory

  9. Type: ren *.json *.

  10. Hit "enter"

DON’T FORGET: Now that you’ve removed the .json file extensions, you will need to re-upload your files to the IPFS network!

Did this answer your question?