diff --git a/src/link.cpp b/src/link.cpp
index 21e6045..1276904 100644
--- a/src/link.cpp
+++ b/src/link.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -61,8 +61,6 @@
   else {
     setContent(nullptr, 0);
   }
-
-  m_isDelSetDirty = true;
 }
 
 void
@@ -75,7 +73,6 @@
   }
 
   m_delList.wireDecode(getContent(), wantSort);
-  m_isDelSetDirty = true;
 }
 
 void
@@ -102,53 +99,4 @@
   return nErased > 0;
 }
 
-Link::PairInitializerListHelper::PairInitializerListHelper(std::initializer_list<std::pair<uint32_t, Name>> dels)
-{
-  for (const auto& p : dels) {
-    m_delList.insert(p.first, p.second, DelegationList::INS_REPLACE);
-  }
-}
-
-Link::Link(const Name& name, PairInitializerListHelper dels)
-  : Data(name)
-  , m_delList(std::move(dels.m_delList))
-{
-  encodeContent();
-}
-
-const Link::DelegationSet&
-Link::getDelegations() const
-{
-  if (m_isDelSetDirty) {
-    m_delSet.clear();
-    for (const auto& del : m_delList) {
-      m_delSet.emplace(static_cast<uint32_t>(del.preference), del.name);
-    }
-    m_isDelSetDirty = false;
-  }
-  return m_delSet;
-}
-
-Link::DelegationTuple
-Link::getDelegationFromWire(const Block& block, size_t index)
-{
-  Delegation del = Link(block, false).getDelegationList().at(index);
-  return std::make_tuple(static_cast<uint32_t>(del.preference), del.name);
-}
-
-ssize_t
-Link::findDelegationFromWire(const Block& block, const Name& delegationName)
-{
-  DelegationList dels = Link(block, false).getDelegationList();
-  auto i = std::find_if(dels.begin(), dels.end(),
-           [delegationName] (const Delegation& del) { return del.name == delegationName; });
-  return i == dels.end() ? -1 : std::distance(dels.begin(), i);
-}
-
-ssize_t
-Link::countDelegationsFromWire(const Block& block)
-{
-  return Link(block, false).getDelegationList().size();
-}
-
 } // namespace ndn
diff --git a/src/link.hpp b/src/link.hpp
index e358404..6a46e02 100644
--- a/src/link.hpp
+++ b/src/link.hpp
@@ -24,7 +24,6 @@
 
 #include "data.hpp"
 #include "delegation-list.hpp"
-#include <set>
 
 namespace ndn {
 
@@ -112,73 +111,12 @@
   bool
   removeDelegation(const Name& name);
 
-public: // deprecated APIs
-  using DelegationSet = std::set<std::pair<uint32_t, Name>>;
-  using DelegationTuple = std::tuple<uint32_t, Name>;
-
-  class PairInitializerListHelper
-  {
-  public:
-    PairInitializerListHelper(std::initializer_list<std::pair<uint32_t, Name>> dels);
-
-  private:
-    DelegationList m_delList;
-    friend class Link;
-  };
-
-  /** @brief Create a Link object with the given name and delegations
-   *  @param name A reference to the name of the redirected namespace
-   *  @param dels Delegations in payload
-   *  @deprecated use Link(const Name&, std::initializer_list<Delegation>)
-   *  @note This overload is selected only if the caller explicitly passes
-   *        std::initializer_list<std::pair<uint32_t, Name>> to Link constructor;
-   *        otherwise, Link(const Name&, std::initializer_list<Delegation>) is preferred.
-   */
-  DEPRECATED(
-  Link(const Name& name, PairInitializerListHelper dels));
-
-  /** @deprecated use getDelegationList()
-   */
-  DEPRECATED(
-  const DelegationSet&
-  getDelegations() const);
-
-  /** @brief gets the delegation at @p index from @p block
-   *  @param block wire format of a Link object
-   *  @param index 0-based index of a delegation in the Link object
-   *  @return delegation preference and name
-   *  @throw std::out_of_range index is out of range
-   *  @deprecated use Link(block, false).getDelegationList().at(index)
-   */
-  DEPRECATED(
-  static DelegationTuple
-  getDelegationFromWire(const Block& block, size_t index));
-
-  /** @brief finds index of a delegation with @p delegationName from @p block
-   *  @param block wire format of a Link object
-   *  @param delegationName delegation name in the Link object
-   *  @return 0-based index of the first delegation with @p delegationName ,
-   *          or -1 if no such delegation exists
-   *  @deprecated find within Link(block, false).getDelegationList()
-   */
-  DEPRECATED(
-  static ssize_t
-  findDelegationFromWire(const Block& block, const Name& delegationName));
-
-  /** @deprecated use Link(block, false).getDelegationList().size()
-   */
-  DEPRECATED(
-  static ssize_t
-  countDelegationsFromWire(const Block& block));
-
 private:
   void
   encodeContent();
 
 private:
   DelegationList m_delList;
-  mutable bool m_isDelSetDirty = false;
-  mutable DelegationSet m_delSet;
 };
 
 } // namespace ndn
diff --git a/tests/unit-tests/link.t.cpp b/tests/unit-tests/link.t.cpp
index ac44917..bdeddef 100644
--- a/tests/unit-tests/link.t.cpp
+++ b/tests/unit-tests/link.t.cpp
@@ -172,46 +172,6 @@
 
 BOOST_AUTO_TEST_SUITE_END() // Modify
 
-BOOST_AUTO_TEST_SUITE(Deprecated)
-
-BOOST_AUTO_TEST_CASE(PairInitializerList)
-{
-  Link link("/test", {{10, "/test1"}, {20, "/test2"}, {100, "/test3"}});
-  Link::DelegationSet ds = link.getDelegations();
-  BOOST_REQUIRE_EQUAL(ds.size(), 3);
-  BOOST_CHECK_EQUAL(ds.begin()->first, 10);
-  BOOST_CHECK_EQUAL(ds.begin()->second, "/test1");
-}
-
-BOOST_AUTO_TEST_CASE(DelegationSet)
-{
-  Link link("/test", {{10, "/test1"}, {20, "/test2"}, {100, "/test3"}});
-  Link::DelegationSet ds = link.getDelegations();
-  BOOST_REQUIRE_EQUAL(ds.size(), 3);
-  BOOST_CHECK_EQUAL(ds.begin()->first, 10);
-  BOOST_CHECK_EQUAL(ds.begin()->second, "/test1");
-}
-
-BOOST_AUTO_TEST_CASE(FromWire)
-{
-  Block linkBlock(GOOD_LINK, sizeof(GOOD_LINK));
-
-  BOOST_CHECK_EQUAL(Link::countDelegationsFromWire(linkBlock), 2);
-
-  auto del0 = Link::getDelegationFromWire(linkBlock, 0);
-  BOOST_CHECK_EQUAL(std::get<0>(del0), 10);
-  BOOST_CHECK_EQUAL(std::get<1>(del0), "/local");
-  auto del1 = Link::getDelegationFromWire(linkBlock, 1);
-  BOOST_CHECK_EQUAL(std::get<0>(del1), 20);
-  BOOST_CHECK_EQUAL(std::get<1>(del1), "/ndn");
-  BOOST_CHECK_THROW(Link::getDelegationFromWire(linkBlock, 2), std::out_of_range);
-
-  BOOST_CHECK_EQUAL(Link::findDelegationFromWire(linkBlock, "/local"), 0);
-  BOOST_CHECK_EQUAL(Link::findDelegationFromWire(linkBlock, "/none"), -1);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // Deprecated
-
 BOOST_AUTO_TEST_SUITE_END() // TestLink
 
 } // namespace tests
