{"id":2245,"date":"2020-11-27T19:31:55","date_gmt":"2020-11-27T18:31:55","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=2245"},"modified":"2020-11-27T20:20:53","modified_gmt":"2020-11-27T19:20:53","slug":"from-wordpress-to-a-static-website","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/","title":{"rendered":"From WordPress to a Static Website"},"content":{"rendered":"<p><strong>WordPress<\/strong> plugins such as the <strong>Simply Static<\/strong> and others have the ability to automatically convert each of the WordPress pages and posts into static HTML files.<br \/>\nI tried it in my environment but without any convincing result: When I double checked, the exported pages did still contain URLs which were pointing to the server, so on first sight everything seemed to work, but if you switch off WordPress the exported files stopped to work as well!<\/p>\n<p>I wanted to have a more reliable way to dump <strong>a whole WordPress Site<\/strong> w\/o having to pay for any unnecessary service and indeed there is an <strong>easy solution<\/strong> by just using <strong>wget<\/strong> which is available on all <strong>Linux<\/strong> or <strong>OS\/X<\/strong> distributions.<\/p>\n<p>I used the following command:<\/p>\n<pre><code>wget -nd -r -k -E  --base=https:\/\/www.pschatzmann.ch  https:\/\/www.pschatzmann.ch\/home\/\n\n<\/code><\/pre>\n<ul>\n<li><strong>nd<\/strong> makes sure that all files are created in one single directory (with no subdirectories!)<\/li>\n<li><strong>r<\/strong> recursive (downloads the index and all related files)<\/li>\n<li><strong>k<\/strong> is converting the links (to point to the local files) after the download has completed<\/li>\n<li><strong>E<\/strong> saves HTML\/CSS documents with proper extensions<\/li>\n<li><strong>base<\/strong> is indicating the base URL which needs to be removed to make sure that all links are relative<\/li>\n<li><strong>https:\/\/www.pschatzmann.ch\/home\/<\/strong> is the URL to the start page of the website which needs to be downloaded<\/li>\n<\/ul>\n<p>The whole website is downloaded and occupies only 41M Bytes.<\/p>\n<p>You can now make sure that <strong>your Webserver<\/strong> is pointing to the <strong>exported directory<\/strong> and then you have your working static Website that looks like your WordPress Site!<\/p>\n<p>This is pretty trivial e.g. with <strong>Docker<\/strong> and <strong>NGINX<\/strong>:<\/p>\n<pre><code>docker run -v \/Users\/pschatzmann\/Downloads\/x\/www.pschatzmann.ch:\/usr\/share\/nginx\/html:ro -d -p80:80 nginx\n<\/code><\/pre>\n<p>where<br \/>\n&#8211; <em>-p80:80<\/em> makes the server available on port 80<br \/>\n&#8211; <em>-d<\/em> runs the server as demon (in the background)<br \/>\n&#8211; <em>\/Users\/pschatzmann\/Downloads\/x\/www.pschatzmann.ch<\/em> is the downloaded directory which contains the index.html<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/Screen-Shot-2020-11-27-at-20.19.31-300x155.png\" alt=\"\" width=\"100%\" height=\"155\" class=\"alignnone size-medium wp-image-2261\" srcset=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/Screen-Shot-2020-11-27-at-20.19.31-300x155.png 300w, https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/Screen-Shot-2020-11-27-at-20.19.31-768x396.png 768w, https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/Screen-Shot-2020-11-27-at-20.19.31.png 1128w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress plugins such as the Simply Static and others have the ability to automatically convert each of the WordPress pages and posts into static HTML files. I tried it in my environment but without any convincing result: When I double checked, the exported pages did still contain URLs which were [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2247,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-2245","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-infrastructure"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>From Wordpress to a Static Website - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"From Wordpress to a Static Website - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"WordPress plugins such as the Simply Static and others have the ability to automatically convert each of the WordPress pages and posts into static HTML files. I tried it in my environment but without any convincing result: When I double checked, the exported pages did still contain URLs which were [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-27T18:31:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-27T19:20:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/files.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"259\" \/>\n\t<meta property=\"og:image:height\" content=\"194\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"From WordPress to a Static Website\",\"datePublished\":\"2020-11-27T18:31:55+00:00\",\"dateModified\":\"2020-11-27T19:20:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/\"},\"wordCount\":302,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/files.jpeg\",\"articleSection\":[\"Infrastructure\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/\",\"name\":\"From Wordpress to a Static Website - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/files.jpeg\",\"datePublished\":\"2020-11-27T18:31:55+00:00\",\"dateModified\":\"2020-11-27T19:20:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/files.jpeg\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/files.jpeg\",\"width\":259,\"height\":194},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/27\\\/from-wordpress-to-a-static-website\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"From WordPress to a Static Website\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"From Wordpress to a Static Website - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/","og_locale":"en_US","og_type":"article","og_title":"From Wordpress to a Static Website - Phil Schatzmann","og_description":"WordPress plugins such as the Simply Static and others have the ability to automatically convert each of the WordPress pages and posts into static HTML files. I tried it in my environment but without any convincing result: When I double checked, the exported pages did still contain URLs which were [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/","og_site_name":"Phil Schatzmann","article_published_time":"2020-11-27T18:31:55+00:00","article_modified_time":"2020-11-27T19:20:53+00:00","og_image":[{"width":259,"height":194,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/files.jpeg","type":"image\/jpeg"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"From WordPress to a Static Website","datePublished":"2020-11-27T18:31:55+00:00","dateModified":"2020-11-27T19:20:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/"},"wordCount":302,"commentCount":1,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/files.jpeg","articleSection":["Infrastructure"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/","url":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/","name":"From Wordpress to a Static Website - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/files.jpeg","datePublished":"2020-11-27T18:31:55+00:00","dateModified":"2020-11-27T19:20:53+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/files.jpeg","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/files.jpeg","width":259,"height":194},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/27\/from-wordpress-to-a-static-website\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"From WordPress to a Static Website"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/2245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=2245"}],"version-history":[{"count":16,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/2245\/revisions"}],"predecessor-version":[{"id":2263,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/2245\/revisions\/2263"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/2247"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=2245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=2245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=2245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}