diff --git a/tools/peek/ndnpoke/main.cpp b/tools/peek/ndnpoke/main.cpp
index 482cf80..669ba2a 100644
--- a/tools/peek/ndnpoke/main.cpp
+++ b/tools/peek/ndnpoke/main.cpp
@@ -53,7 +53,6 @@
   std::string progName(argv[0]);
   PokeOptions options;
   std::string signingStr;
-  bool wantDigestSha256 = false;
 
   po::options_description genericOptDesc("Generic options");
   genericOptDesc.add_options()
@@ -81,15 +80,8 @@
   hiddenOptDesc.add_options()
     ("name", po::value<std::string>(), "Data name");
 
-  po::options_description deprecatedOptDesc;
-  deprecatedOptDesc.add_options()
-    ("force,f",     po::bool_switch())
-    ("identity,i",  po::value<std::string>())
-    ("digest,D",    po::bool_switch(&wantDigestSha256))
-  ;
-
   po::options_description optDesc;
-  optDesc.add(visibleOptDesc).add(hiddenOptDesc).add(deprecatedOptDesc);
+  optDesc.add(visibleOptDesc).add(hiddenOptDesc);
 
   po::positional_options_description optPos;
   optPos.add("name", -1);
@@ -104,16 +96,6 @@
     return 2;
   }
 
-  if (vm["force"].as<bool>()) {
-    std::cerr << "WARNING: option '-f/--force' is deprecated and will be removed "
-                 "in the near future. Use '-u/--unsolicited' instead." << std::endl;
-    options.wantUnsolicited = true;
-  }
-  if (wantDigestSha256 || vm.count("identity") > 0) {
-    std::cerr << "WARNING: options '-i/--identity' and '-D/--digest' are deprecated and will be "
-                 "removed in the near future. Use '-S/--signing-info' instead." << std::endl;
-  }
-
   if (vm.count("help") > 0) {
     usage(std::cout, progName, visibleOptDesc);
     return 0;
@@ -149,24 +131,6 @@
     return 2;
   }
 
-  if (vm.count("identity") > 0) {
-    if (wantDigestSha256) {
-      std::cerr << "ERROR: conflicting '--digest' and '--identity' options specified" << std::endl;
-      return 2;
-    }
-    try {
-      options.signingInfo.setSigningIdentity(vm["identity"].as<std::string>());
-    }
-    catch (const Name::Error& e) {
-      std::cerr << "ERROR: invalid identity name: " << e.what() << std::endl;
-      return 2;
-    }
-  }
-
-  if (wantDigestSha256) {
-    options.signingInfo.setSha256Signing();
-  }
-
   try {
     options.signingInfo = security::SigningInfo(signingStr);
   }
diff --git a/tools/ping/server/main.cpp b/tools/ping/server/main.cpp
index d43f1d2..e81125c 100644
--- a/tools/ping/server/main.cpp
+++ b/tools/ping/server/main.cpp
@@ -127,13 +127,8 @@
   hiddenDesc.add_options()
     ("prefix", po::value<std::string>(&prefix));
 
-  po::options_description deprecatedDesc;
-  deprecatedDesc.add_options()
-    ("_deprecated_freshness_,x", po::value<time::milliseconds::rep>())
-    ;
-
   po::options_description optDesc;
-  optDesc.add(visibleDesc).add(hiddenDesc).add(deprecatedDesc);
+  optDesc.add(visibleDesc).add(hiddenDesc);
 
   po::positional_options_description posDesc;
   posDesc.add("prefix", -1);
@@ -154,11 +149,6 @@
     return 2;
   }
 
-  if (vm.count("_deprecated_freshness_") > 0) {
-    std::cerr << "WARNING: short option '-x' is deprecated and will be removed in the near "
-                 "future. Please use '-f' or the long form '--freshness'." << std::endl;
-  }
-
   if (vm.count("help") > 0) {
     usage(std::cout, argv[0], visibleDesc);
     return 0;
@@ -177,9 +167,6 @@
   options.prefix = prefix;
 
   options.freshnessPeriod = time::milliseconds(vm["freshness"].as<time::milliseconds::rep>());
-  if (vm.count("_deprecated_freshness_") > 0) {
-    options.freshnessPeriod = time::milliseconds(vm["_deprecated_freshness_"].as<time::milliseconds::rep>());
-  }
   if (options.freshnessPeriod < 0_ms) {
     std::cerr << "ERROR: FreshnessPeriod cannot be negative" << std::endl;
     return 2;
