Difficulty Editing Metadata Tags to Hide Cell Inputs and Outputs

Your title references ‘metadata’; however, you are editing the tags component for the cell.

The process can be demonstrated and tested in current JupyterLab. Click here to spin up a JupyterLab session using this repo for the content. The session is backed by MyBinder.org. The ‘index’ notebook will open. Click the blue bar next to the first code cell to hide the code cell. Save the notebook, and using the file navigator on the right open it in the editor by right-clicking on the file in the list, selecting open with ‘Editor’.

If you look in the editor, you’ll see cell the data for that cell is the following:

{
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "jupyter": {
     "source_hidden": true
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns"
   ]
  },

The key part in there is:

"metadata": {
    "jupyter": {
     "source_hidden": true
    },

The fact JupyterLab respects that setting can be demonstrated by clicking here where a JupyterLab session will open with the notebook I had saved already following what I suggested above. You’ll see the 2nd code cell, under 'Setup our imports, is the one visible when this notebook is reopened. (Notebook is here; however, you’ll note nbviewer, and github, doesn’t respect the hidden setting at this time).

This process of toggling settings and the fact JupyterLab respects the settings upon reopening is discussed here and here. You’ll want to pay special attention to the link at the end of that second listed link as it shows the proper syntax for the settings. You’ll note ‘hide_input’ does not appear on that page.

I believe you may have been finding information on the old classic notebook extension for the hide_code extension perhaps. I’m not sure what sources you are consulting as you don’t list them.

If you are using the editor to hand-edit the metadata direct in JupyterLab as you describe in your post, you’ll probably need to refresh the browser view in JupyterLab. It probably will note the change though in the backing code and let your reload with the new edit if you give it a chance.