To auto-insert footnotes in the block editor after a CSV import:
- Pre-process the CSV: Modify your post content in the CSV to include footnote block syntax (e.g.,
<!-- wp:footnote -->).
- Use a Plugin: Consider using plugins like Modern Footnotes to handle
[footnote] syntax automatically in the block editor.
- Custom Script: Write a custom PHP script to replace footnote markers (e.g.,
[1]) with the proper footnote block structure during import.
These approaches will let you avoid manually adding footnote blocks after import.
These approaches will help, just like my approach with the (Calcvat uk) site:
-
This reply was modified 1 year, 1 month ago by
calc20.
I tried #1 by editing a test post on the code editor :
<ol>
<li>This is the first item.
<!-- wp:footnote -->
<p>This is your footnote content for item 1.</p>
<!-- /wp:footnote -->
</li>
<li>This is the second item.</li>
<li>This is the third item.</li>
</ol>
… and I get this message in the visual editor:
Your site doesn’t include support for the “core/footnote” block. You can leave it as-is, convert it to custom HTML, or remove it.
How should I implement it?
As a side note, when I manually add the footnote block I see that there’s a lot more going on in the code:
<sup data-fn="652a5e8c-3be6-437d-b170-9068ce035379" class="fn"><a href="#652a5e8c-3be6-437d-b170-9068ce035379" id="652a5e8c-3be6-437d-b170-9068ce035379-link">1</a></sup>
<a href="#652a5e8c-3be6-437d-b170-9068ce035379" id="652a5e8c-3be6-437d-b170-9068ce035379-link">1</a>
</sup>
… and then further down:
ol class="wp-block-footnotes"><li id="652a5e8c-3be6-437d-b170-9068ce035379">Footnote text. <a href="#652a5e8c-3be6-437d-b170-9068ce035379-link" aria-label="Jump to footnote reference 1">↩︎</a></li></ol>
# 2 – This is what I was trying to avoid with this setup if possible…